Class: Iro::OptionWatch
- Inherits:
-
Object
- Object
- Iro::OptionWatch
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/iro/option_watch.rb
Overview
for alerting
Constant Summary collapse
- KIND_OPTION =
'option'- KIND_STOCK =
'stock'- KINDS =
[ KIND_OPTION, KIND_STOCK ]
- NOTIFICATION_TYPES =
validates :expirationDate, presence: true
[ :NONE, :EMAIL, :SMS ]
- ACTIONS =
NOTIFICATION_TYPES- NOTIFICATION_NONE =
:NONE- NOTIFICATION_EMAIL =
:EMAIL- NOTIFICATION_SMS =
:SMS- STATE_ACTIVE =
'active'- STATE_INACTIVE =
'inactive'- STATES =
[ STATE_ACTIVE, STATE_INACTIVE ]
- DIRECTION_ABOVE =
:ABOVE- DIRECTION_BELOW =
:BELOW- DIRECTIONS =
[ :ABOVE, :BELOW ]
Class Method Summary collapse
Instance Method Summary collapse
-
#mark ⇒ Object
What is the price of the option at some strike?.
-
#strike ⇒ Object
Strike isn’t the same as price!.
Class Method Details
.actions_list ⇒ Object
44 45 46 |
# File 'lib/iro/option_watch.rb', line 44 def self.actions_list [nil] + ACTIONS end |
.directions_list ⇒ Object
63 64 65 |
# File 'lib/iro/option_watch.rb', line 63 def self.directions_list [nil] + DIRECTIONS end |
.kinds_list ⇒ Object
20 21 22 |
# File 'lib/iro/option_watch.rb', line 20 def self.kinds_list [ nil, 'option', 'stock' ] end |
.states_list ⇒ Object
54 55 56 |
# File 'lib/iro/option_watch.rb', line 54 def self.states_list [ nil, 'active', 'inactive' ] end |
Instance Method Details
#mark ⇒ Object
What is the price of the option at some strike?
29 |
# File 'lib/iro/option_watch.rb', line 29 field :mark, type: Float |
#strike ⇒ Object
Strike isn’t the same as price!
25 |
# File 'lib/iro/option_watch.rb', line 25 field :strike, :type => Float |