Class: Tradier::OptionQuote

Inherits:
Base
  • Object
show all
Defined in:
lib/tradier/option_quote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #attr_equal, attr_reader, #attrs, #attrs_equal, from_response, #initialize, #update

Constructor Details

This class inherits a constructor from Tradier::Base

Instance Attribute Details

#askObject (readonly)

Returns the value of attribute ask.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def ask
  @ask
end

#ask_sizeObject (readonly)

Returns the value of attribute ask_size.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def ask_size
  @ask_size
end

#bidObject (readonly)

Returns the value of attribute bid.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def bid
  @bid
end

#bid_sizeObject (readonly)

Returns the value of attribute bid_size.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def bid_size
  @bid_size
end

#changeObject (readonly)

Returns the value of attribute change.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def change
  @change
end

#lastObject (readonly)

Returns the value of attribute last.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def last
  @last
end

#open_interestObject (readonly)

Returns the value of attribute open_interest.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def open_interest
  @open_interest
end

#strikeObject (readonly)

Returns the value of attribute strike.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def strike
  @strike
end

#symbolObject (readonly)

Returns the value of attribute symbol.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def symbol
  @symbol
end

#volumeObject (readonly)

Returns the value of attribute volume.



7
8
9
# File 'lib/tradier/option_quote.rb', line 7

def volume
  @volume
end

Instance Method Details

#==(option_quote) ⇒ Object



27
28
29
# File 'lib/tradier/option_quote.rb', line 27

def ==(option_quote)
  self.symbol == option_quote.symbol
end

#call?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/tradier/option_quote.rb', line 13

def call?
  parsed_symbol.call?
end

#expiration_dateObject



21
22
23
24
25
# File 'lib/tradier/option_quote.rb', line 21

def expiration_date
  return unless @expiration_date || @attrs[:expiration_date]

  @expiration_date ||= Date.parse(@attrs[:expiration_date])
end

#put?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/tradier/option_quote.rb', line 9

def put?
  parsed_symbol.put?
end

#underlierObject



17
18
19
# File 'lib/tradier/option_quote.rb', line 17

def underlier
  parsed_symbol.underlier
end