Class: OzonLogistics::DynamicSetting
- Inherits:
-
Object
- Object
- OzonLogistics::DynamicSetting
- Defined in:
- lib/ozon-logistics.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(setting) ⇒ DynamicSetting
constructor
A new instance of DynamicSetting.
- #value(*_args) ⇒ Object
Constructor Details
#initialize(setting) ⇒ DynamicSetting
Returns a new instance of DynamicSetting.
50 51 52 |
# File 'lib/ozon-logistics.rb', line 50 def initialize(setting) @setting = setting end |
Class Method Details
.build(setting, type) ⇒ Object
40 41 42 |
# File 'lib/ozon-logistics.rb', line 40 def self.build(setting, type) (type ? klass(type) : self).new(setting) end |
.klass(type) ⇒ Object
44 45 46 47 48 |
# File 'lib/ozon-logistics.rb', line 44 def self.klass(type) klass = "#{type.to_s.camelcase}Setting" raise ArgumentError, "Unknown type: #{type}" unless OzonLogistics.const_defined?(klass) OzonLogistics.const_get(klass) end |
Instance Method Details
#value(*_args) ⇒ Object
54 55 56 |
# File 'lib/ozon-logistics.rb', line 54 def value(*_args) @setting end |