Skip to content

Commit

Permalink
renamed #servicename to #service_name /cc #22
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Apr 21, 2013
1 parent bf71886 commit 7ccca13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/wasabi/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def operations
end

# Returns the service name.
def servicename
@servicename ||= parser.servicename
def service_name
@service_name ||= parser.service_name
end

attr_writer :servicename
attr_writer :service_name

def type_namespaces
@type_namespaces ||= begin
Expand Down
12 changes: 6 additions & 6 deletions lib/wasabi/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(document)
self.document = document
self.operations = {}
self.namespaces = {}
self.servicename = ''
self.service_name = ''
self.types = {}
self.deferred_types = []
self.element_form_default = :unqualified
Expand Down Expand Up @@ -42,15 +42,15 @@ def initialize(document)
attr_accessor :endpoint

# Returns the SOAP Service Name
attr_accessor :servicename
attr_accessor :service_name

# Returns the elementFormDefault value.
attr_accessor :element_form_default

def parse
parse_namespaces
parse_endpoint
parse_servicename
parse_service_name
parse_operations
parse_types
parse_deferred_types
Expand Down Expand Up @@ -80,9 +80,9 @@ def parse_endpoint
end
end

def parse_servicename
servicename = at_xpath("wsdl:definitions/@name")
@servicename = servicename.to_s if servicename
def parse_service_name
service_name = at_xpath("wsdl:definitions/@name")
@service_name = service_name.to_s if service_name
end

def parse_operations
Expand Down
6 changes: 2 additions & 4 deletions spec/wasabi/parser/get_servicename_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@

let(:xml) { fixture(:geotrust).read }

it "does return the servicename attribute" do
name = subject.servicename

name.should == "queryDefinitions"
it "returns the #service_name attribute" do
subject.service_name.should == "queryDefinitions"
end

end
Expand Down

0 comments on commit 7ccca13

Please sign in to comment.