Class: LedgerSync::AdaptorConfiguration
- Inherits:
-
Object
- Object
- LedgerSync::AdaptorConfiguration
- Includes:
- Fingerprintable::Mixin, SimplySerializable::Mixin
- Defined in:
- lib/ledger_sync/adaptor_configuration.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#module ⇒ Object
Returns the value of attribute module.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rate_limiting_wait_in_seconds ⇒ Object
Returns the value of attribute rate_limiting_wait_in_seconds.
-
#root_key ⇒ Object
readonly
Returns the value of attribute root_key.
-
#test ⇒ Object
Returns the value of attribute test.
Instance Method Summary collapse
- #adaptor_klass ⇒ Object
- #add_alias(new_alias) ⇒ Object
- #base_module ⇒ Object
-
#initialize(root_key) ⇒ AdaptorConfiguration
constructor
A new instance of AdaptorConfiguration.
-
#new(*args) ⇒ Object
Delegate new to the adaptor class enabling faster adaptor initialization e.g.
- #test? ⇒ Boolean
Constructor Details
#initialize(root_key) ⇒ AdaptorConfiguration
Returns a new instance of AdaptorConfiguration.
24 25 26 27 28 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 24 def initialize(root_key) @root_key = root_key @aliases = [] @module = LedgerSync::Util::StringHelpers.camelcase(root_key) end |
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases.
13 14 15 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 13 def aliases @aliases end |
#module ⇒ Object
Returns the value of attribute module.
8 9 10 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 8 def module @module end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 8 def name @name end |
#rate_limiting_wait_in_seconds ⇒ Object
Returns the value of attribute rate_limiting_wait_in_seconds.
8 9 10 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 8 def rate_limiting_wait_in_seconds @rate_limiting_wait_in_seconds end |
#root_key ⇒ Object (readonly)
Returns the value of attribute root_key.
13 14 15 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 13 def root_key @root_key end |
#test ⇒ Object
Returns the value of attribute test.
8 9 10 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 8 def test @test end |
Instance Method Details
#adaptor_klass ⇒ Object
30 31 32 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 30 def adaptor_klass @adaptor_klass ||= base_module::Adaptor end |
#add_alias(new_alias) ⇒ Object
40 41 42 43 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 40 def add_alias(new_alias) @aliases << new_alias LedgerSync.adaptors.add_alias(new_alias, self) end |
#base_module ⇒ Object
34 35 36 37 38 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 34 def base_module @base_module ||= begin LedgerSync::Adaptors.const_get(@module) end end |
#new(*args) ⇒ Object
Delegate new to the adaptor class enabling faster adaptor initialization e.g. LedgerSync.adaptors.test.new(…)
47 48 49 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 47 def new(*args) adaptor_klass.new(*args) end |
#test? ⇒ Boolean
51 52 53 |
# File 'lib/ledger_sync/adaptor_configuration.rb', line 51 def test? test == true end |