Class: Ohbjects::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/ohbjects/options.rb

Direct Known Subclasses

Call, Put

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOption

Returns a new instance of Option.



52
53
54
55
56
# File 'lib/ohbjects/options.rb', line 52

def initialize
  if instance_of? Option
    raise ArgumentError, "An option cannot be instantiated"
  end
end

Instance Attribute Details

#askObject

Returns the value of attribute ask.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def ask
  @ask
end

#asksObject

Returns the value of attribute asks.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def asks
  @asks
end

#bidObject

Returns the value of attribute bid.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def bid
  @bid
end

#bidsObject

Returns the value of attribute bids.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def bids
  @bids
end

#changeObject

Returns the value of attribute change.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def change
  @change
end

#deltaObject

Returns the value of attribute delta.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def delta
  @delta
end

#expiresObject

Returns the value of attribute expires.



50
51
52
# File 'lib/ohbjects/options.rb', line 50

def expires
  @expires
end

#gammaObject

Returns the value of attribute gamma.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def gamma
  @gamma
end

#idObject

Returns the value of attribute id.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def id
  @id
end

#ivObject

Returns the value of attribute iv.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def iv
  @iv
end

#keyObject

Returns the value of attribute key.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def key
  @key
end

#open_interestObject

Returns the value of attribute open_interest.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def open_interest
  @open_interest
end

#rootObject

Returns the value of attribute root.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def root
  @root
end

#strikeObject

Returns the value of attribute strike.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def strike
  @strike
end

#thetaObject

Returns the value of attribute theta.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def theta
  @theta
end

#vegaObject

Returns the value of attribute vega.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def vega
  @vega
end

#volumeObject

Returns the value of attribute volume.



45
46
47
# File 'lib/ohbjects/options.rb', line 45

def volume
  @volume
end

Instance Method Details

#call?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/ohbjects/options.rb', line 64

def call?
  Call === self
end

#put?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/ohbjects/options.rb', line 68

def put?
  Put === self
end