Class: LHC::Response::Data::Item
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- LHC::Response::Data::Item
- Includes:
- Base
- Defined in:
- lib/lhc/response/data/item.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(response, data: nil) ⇒ Item
constructor
A new instance of Item.
Methods included from Base
Constructor Details
#initialize(response, data: nil) ⇒ Item
Returns a new instance of Item.
6 7 8 9 10 11 12 13 |
# File 'lib/lhc/response/data/item.rb', line 6 def initialize(response, data: nil) @response = response @data = data set_dynamic_accessor_methods super(as_json) end |
Instance Method Details
#[](key) ⇒ Object
15 16 17 18 |
# File 'lib/lhc/response/data/item.rb', line 15 def [](key) @hash ||= as_json.with_indifferent_access @hash[key] end |