Class: Coinigy::Alert
Overview
Represents an Alert on a market
Constant Summary
- ABOVE =
Alert operator types
:>.freeze
- BELOW =
:<.freeze
Instance Attribute Summary collapse
-
#alert_added ⇒ Object
Returns the value of attribute alert_added.
-
#alert_history_id ⇒ Object
Returns the value of attribute alert_history_id.
-
#alert_id ⇒ Object
Returns the value of attribute alert_id.
-
#alert_note ⇒ Object
Returns the value of attribute alert_note.
-
#alert_price ⇒ Object
Returns the value of attribute alert_price.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#exch_code ⇒ Object
Returns the value of attribute exch_code.
-
#exch_name ⇒ Object
Returns the value of attribute exch_name.
-
#exchange ⇒ Object
Relations.
-
#market ⇒ Object
Relations.
-
#mkt_name ⇒ Object
Returns the value of attribute mkt_name.
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#operator_text ⇒ Object
Returns the value of attribute operator_text.
-
#price ⇒ Object
Returns the value of attribute price.
-
#subscription ⇒ Object
Relations.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#errors?, #initialize, #inspect, #save
Constructor Details
This class inherits a constructor from Coinigy::Model
Instance Attribute Details
#alert_added ⇒ Object
Returns the value of attribute alert_added
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def alert_added @alert_added end |
#alert_history_id ⇒ Object
Returns the value of attribute alert_history_id
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def alert_history_id @alert_history_id end |
#alert_id ⇒ Object
Returns the value of attribute alert_id
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def alert_id @alert_id end |
#alert_note ⇒ Object
Returns the value of attribute alert_note
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def alert_note @alert_note end |
#alert_price ⇒ Object
Returns the value of attribute alert_price
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def alert_price @alert_price end |
#display_name ⇒ Object
Returns the value of attribute display_name
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def display_name @display_name end |
#exch_code ⇒ Object
Returns the value of attribute exch_code
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def exch_code @exch_code end |
#exch_name ⇒ Object
Returns the value of attribute exch_name
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def exch_name @exch_name end |
#exchange ⇒ Object
Relations
17 18 19 |
# File 'lib/coinigy/alert.rb', line 17 def exchange @exchange end |
#market ⇒ Object
Relations
17 18 19 |
# File 'lib/coinigy/alert.rb', line 17 def market @market end |
#mkt_name ⇒ Object
Returns the value of attribute mkt_name
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def mkt_name @mkt_name end |
#operator ⇒ Object
Returns the value of attribute operator
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def operator @operator end |
#operator_text ⇒ Object
Returns the value of attribute operator_text
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def operator_text @operator_text end |
#price ⇒ Object
Returns the value of attribute price
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def price @price end |
#subscription ⇒ Object
Relations
17 18 19 |
# File 'lib/coinigy/alert.rb', line 17 def subscription @subscription end |
#timestamp ⇒ Object
Returns the value of attribute timestamp
8 9 10 |
# File 'lib/coinigy/alert.rb', line 8 def @timestamp end |
Instance Method Details
#attributes ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/coinigy/alert.rb', line 19 def attributes { 'exch_name' => exch_name, 'mkt_name' => mkt_name, 'price' => price, 'operator' => operator, 'alert_id' => alert_id, 'operator_text' => operator_text, 'alert_note' => alert_note, 'alert_added' => alert_added, 'display_name' => display_name, 'exch_code' => exch_code, 'alert_history_id' => alert_history_id, 'timestamp' => , 'alert_price' => alert_price } end |
#cancel ⇒ Object
56 57 58 |
# File 'lib/coinigy/alert.rb', line 56 def cancel subscription.client.delete_alert(alert_id) end |
#place ⇒ Object
43 44 45 46 47 48 |
# File 'lib/coinigy/alert.rb', line 43 def place subscription.client.add_alert('exch_code' => exch_code, 'market_name' => mkt_name, 'alert_price' => price, 'alert_note' => alert_note) end |
#replace(changes = {}) ⇒ Object
50 51 52 53 54 |
# File 'lib/coinigy/alert.rb', line 50 def replace(changes = {}) cancel assign_attributes(changes.slice(:price, :note)) place end |