Class: Preverus::ApiResult
- Inherits:
-
Object
- Object
- Preverus::ApiResult
- Defined in:
- lib/preverus/results.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(data) ⇒ ApiResult
constructor
A new instance of ApiResult.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ ApiResult
Returns a new instance of ApiResult.
5 6 7 |
# File 'lib/preverus/results.rb', line 5 def initialize(data) @data = data || {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/preverus/results.rb', line 3 def data @data end |
Instance Method Details
#[](key) ⇒ Object
9 10 11 |
# File 'lib/preverus/results.rb', line 9 def [](key) @data[key.to_s] || @data[key.to_sym] end |
#to_h ⇒ Object
13 14 15 |
# File 'lib/preverus/results.rb', line 13 def to_h @data.dup end |