Class: BitFlyer::Models::BoardState
- Inherits:
-
Object
- Object
- BitFlyer::Models::BoardState
- Defined in:
- lib/bit_flyer/models/board_state.rb
Instance Attribute Summary collapse
-
#health ⇒ Object
readonly
Returns the value of attribute health.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(attrs = {}) ⇒ BoardState
constructor
A new instance of BoardState.
Constructor Details
#initialize(attrs = {}) ⇒ BoardState
Returns a new instance of BoardState.
6 7 8 9 10 |
# File 'lib/bit_flyer/models/board_state.rb', line 6 def initialize(attrs = {}) @attrs = attrs @health = attrs['health'] @state = attrs['state'] end |
Instance Attribute Details
#health ⇒ Object (readonly)
Returns the value of attribute health.
4 5 6 |
# File 'lib/bit_flyer/models/board_state.rb', line 4 def health @health end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/bit_flyer/models/board_state.rb', line 4 def state @state end |
Instance Method Details
#data ⇒ Object
12 13 14 |
# File 'lib/bit_flyer/models/board_state.rb', line 12 def data @data ||= @attrs['data'].present? ? BitFlyer::Models::BoardStates::Data.new(@attrs['data']) : nil end |