Class: MLBStatsAPI::Base
- Inherits:
-
Object
- Object
- MLBStatsAPI::Base
- Defined in:
- lib/mlb_stats_api/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #dig(*path) ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/mlb_stats_api/base.rb', line 7 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/mlb_stats_api/base.rb', line 5 def data @data end |
Instance Method Details
#[](key) ⇒ Object
11 12 13 |
# File 'lib/mlb_stats_api/base.rb', line 11 def [](key) @data[key] end |
#dig(*path) ⇒ Object
15 16 17 |
# File 'lib/mlb_stats_api/base.rb', line 15 def dig(*path) @data.dig(*path) end |