Class: BitFlyer::Models::BoardState

Inherits:
Object
  • Object
show all
Defined in:
lib/bit_flyer/models/board_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#healthObject (readonly)

Returns the value of attribute health.



4
5
6
# File 'lib/bit_flyer/models/board_state.rb', line 4

def health
  @health
end

#stateObject (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

#dataObject



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