Class: Rnfse::API
- Inherits:
-
Object
- Object
- Rnfse::API
- Defined in:
- lib/rnfse/api.rb
Defined Under Namespace
Modules: Abrasf10, IssNet10, SpeedGov10
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#key ⇒ Object
Returns the value of attribute key.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#soap_client ⇒ Object
Returns the value of attribute soap_client.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#xml_builder ⇒ Object
Returns the value of attribute xml_builder.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(options = {}) ⇒ API
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rnfse/api.rb', line 15 def initialize( = {}) = () case when (, 'provedor', 'homologacao') provedor = provedores['homologacao'][['provedor'].to_s] raise ArgumentError, 'provedor de homologação inexistente', caller if provedor.nil? self.api = provedor['api'] = :load_options_for_staging when (, 'provedor', 'municipio') provedor = provedores['producao'][['provedor'].to_s] raise ArgumentError, 'provedor inexistente', caller if provedor.nil? self.api = provedor['api'] = :load_options_for_production when (, 'padrao', 'namespace', 'endpoint') self.api = ['padrao'].to_s = :load_options_for_custom else raise ArgumentError, 'opções inválidas', caller end extend self.class.const_get(String.camelize(self.api)) self.send(, ) end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
8 9 10 |
# File 'lib/rnfse/api.rb', line 8 def api @api end |
#certificate ⇒ Object
Returns the value of attribute certificate.
9 10 11 |
# File 'lib/rnfse/api.rb', line 9 def certificate @certificate end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/rnfse/api.rb', line 7 def endpoint @endpoint end |
#key ⇒ Object
Returns the value of attribute key.
10 11 12 |
# File 'lib/rnfse/api.rb', line 10 def key @key end |
#namespace ⇒ Object
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/rnfse/api.rb', line 6 def namespace @namespace end |
#soap_client ⇒ Object
Returns the value of attribute soap_client.
12 13 14 |
# File 'lib/rnfse/api.rb', line 12 def soap_client @soap_client end |
#verbose ⇒ Object
Returns the value of attribute verbose.
13 14 15 |
# File 'lib/rnfse/api.rb', line 13 def verbose @verbose end |
#xml_builder ⇒ Object
Returns the value of attribute xml_builder.
11 12 13 |
# File 'lib/rnfse/api.rb', line 11 def xml_builder @xml_builder end |