Class: Cccode::Soap

Inherits:
Object
  • Object
show all
Defined in:
lib/soap.rb

Constant Summary collapse

WSDL =
'http://www.webservicex.net/country.asmx?WSDL'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSoap

Returns a new instance of Soap.



14
15
# File 'lib/soap.rb', line 14

def initialize
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



9
10
11
# File 'lib/soap.rb', line 9

def client
  @client
end

#commandObject

Returns the value of attribute command.



9
10
11
# File 'lib/soap.rb', line 9

def command
  @command
end

#countriesObject

Returns the value of attribute countries.



9
10
11
# File 'lib/soap.rb', line 9

def countries
  @countries
end

#countryObject

Returns the value of attribute country.



9
10
11
# File 'lib/soap.rb', line 9

def country
  @country
end

#country_code(country = nil) ⇒ Object

Returns the value of attribute country_code.



9
10
11
# File 'lib/soap.rb', line 9

def country_code
  @country_code
end

#currenciesObject

Returns the value of attribute currencies.



9
10
11
# File 'lib/soap.rb', line 9

def currencies
  @currencies
end

#currency(country = nil) ⇒ Object

Returns the value of attribute currency.



9
10
11
# File 'lib/soap.rb', line 9

def currency
  @currency
end

#currency_code(currency = nil) ⇒ Object

Returns the value of attribute currency_code.



9
10
11
# File 'lib/soap.rb', line 9

def currency_code
  @currency_code
end

#messageObject

Returns the value of attribute message.



9
10
11
# File 'lib/soap.rb', line 9

def message
  @message
end

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/soap.rb', line 9

def response
  @response
end

#result=(value) ⇒ Object

Sets the attribute result

Parameters:

  • value

    the value to set the attribute result to.



9
10
11
# File 'lib/soap.rb', line 9

def result=(value)
  @result = value
end

#result_keysObject

Returns the value of attribute result_keys.



9
10
11
# File 'lib/soap.rb', line 9

def result_keys
  @result_keys
end

#xmlObject

Returns the value of attribute xml.



9
10
11
# File 'lib/soap.rb', line 9

def xml
  @xml
end

Class Method Details

.table_empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/soap.rb', line 22

def self.table_empty?
  !Cccode::CountryCode.exists?
end

Instance Method Details

#get_allObject



30
31
32
33
# File 'lib/soap.rb', line 30

def get_all
  get_xml(:get_currency_code)
  Cccode::CountryCode.insert_all(@xml)
end

#table_empty?Boolean

todo: needed here? only model direct?

Returns:

  • (Boolean)


18
19
20
# File 'lib/soap.rb', line 18

def table_empty?
  Cccode::Soap.table_empty?
end