Class: Otter::Base
- Inherits:
-
Object
- Object
- Otter::Base
- Defined in:
- lib/otter/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/otter/base.rb', line 14 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/otter/base.rb', line 4 def data @data end |
Class Method Details
.create(data) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/otter/base.rb', line 6 def self.create(data) if data['list'].is_a?(Array) data['list'].map { |d| self.new(d) } else self.new(data) end end |