Sha256: 12df3469cc04d352493cfc4df1f7896cc8650888216e8e5a5502cb5222091f8c

Contents?: true

Size: 776 Bytes

Versions: 96

Compression:

Stored size: 776 Bytes

Contents

#
# This is not used... not worth the time to change. Use IshModels::StockWatch instead
# _vp_ 20171026
#
class Ish::StockWatch
  include Mongoid::Document
  include Mongoid::Timestamps

  store_in :collection => 'ish_stock_watch'

  field :ticker

  NOTIFICATION_TYPES = [ :NONE, :EMAIL, :SMS ]
  NOTIFICATION_NONE  = :NONE
  NOTIFICATION_EMAIL = :EMAIL
  NOTIFICATION_SMS   = :SMS
  ACTIONS = NOTIFICATION_TYPES
  field :notification_type, :type => Symbol, :as => :action
  field :price, :type => Float

  DIRECTIONS      = [ :ABOVE, :BELOW ]
  DIRECTION_ABOVE = :ABOVE
  DIRECTION_BELOW = :BELOW
  field :direction, :type => Symbol

  belongs_to :profile, :class_name => 'IshModels::UserProfile'

  def to_s
    "#{self.ticker} #{self.direction} #{self.price}"
  end

end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
ish_models-0.0.33.140 lib/ish/stock_watch.rb
ish_models-0.0.33.139 lib/ish/stock_watch.rb
ish_models-0.0.33.138 lib/ish/stock_watch.rb
ish_models-0.0.33.137 lib/ish/stock_watch.rb
ish_models-0.0.33.136 lib/ish/stock_watch.rb
ish_models-0.0.33.135 lib/ish/stock_watch.rb
ish_models-0.0.33.134 lib/ish/stock_watch.rb
ish_models-0.0.33.133 lib/ish/stock_watch.rb
ish_models-0.0.33.132 lib/ish/stock_watch.rb
ish_models-0.0.33.131 lib/ish/stock_watch.rb
ish_models-0.0.33.130 lib/ish/stock_watch.rb
ish_models-0.0.33.129 lib/ish/stock_watch.rb
ish_models-0.0.33.128 lib/ish/stock_watch.rb
ish_models-0.0.33.127 lib/ish/stock_watch.rb
ish_models-0.0.33.124 lib/ish/stock_watch.rb
ish_models-0.0.33.123 lib/ish/stock_watch.rb
ish_models-0.0.33.122 lib/ish/stock_watch.rb
ish_models-0.0.33.121 lib/ish/stock_watch.rb
ish_models-0.0.33.120 lib/ish/stock_watch.rb
ish_models-0.0.33.119 lib/ish/stock_watch.rb