Class: Flashboy::Quote

Inherits:
Object
  • Object
show all
Defined in:
lib/flashboy/quote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Quote

Returns a new instance of Quote.



5
6
7
8
9
10
11
12
# File 'lib/flashboy/quote.rb', line 5

def initialize(data)
  @exchange = data[:exchange].to_s
  @pair = data[:pair].to_s
  @bid = data[:bid].to_s.to_f
  @ask = data[:ask].to_s.to_f
  @last = data[:last].to_s.to_f
  @volume = data[:volume].to_s.to_f
end

Instance Attribute Details

#askObject (readonly)

Returns the value of attribute ask.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def ask
  @ask
end

#bidObject (readonly)

Returns the value of attribute bid.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def bid
  @bid
end

#exchangeObject (readonly)

Returns the value of attribute exchange.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def exchange
  @exchange
end

#lastObject (readonly)

Returns the value of attribute last.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def last
  @last
end

#pairObject (readonly)

Returns the value of attribute pair.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def pair
  @pair
end

#volumeObject (readonly)

Returns the value of attribute volume.



3
4
5
# File 'lib/flashboy/quote.rb', line 3

def volume
  @volume
end