Class: Beanie::BeanieAlert
Constant Summary collapse
- STATE_NEW =
0- STATE_READ =
1- STATE_ARCHIVED =
2- STATE_NAMES =
[ ["New (Unread)", STATE_NEW], ["Acknowledged (Read)", STATE_READ], ["Archived", STATE_ARCHIVED] ].freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#member_id ⇒ Object
Returns the value of attribute member_id.
-
#message ⇒ Object
Returns the value of attribute message.
-
#state ⇒ Object
Returns the value of attribute state.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ BeanieAlert
constructor
Initialize instance variables.
-
#state_name ⇒ Object
Printable form of the state name.
-
#unread? ⇒ Boolean
Is this an unread message?.
Methods inherited from Api
all, build_url, #construct_path, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers
Constructor Details
#initialize ⇒ BeanieAlert
Initialize instance variables
46 47 48 49 50 51 52 |
# File 'lib/beanie/beanie_alert.rb', line 46 def initialize @id = nil @state = nil = nil @url = nil @member_id = nil end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
32 33 34 |
# File 'lib/beanie/beanie_alert.rb', line 32 def id @id end |
#member_id ⇒ Object
Returns the value of attribute member_id.
32 33 34 |
# File 'lib/beanie/beanie_alert.rb', line 32 def member_id @member_id end |
#message ⇒ Object
Returns the value of attribute message.
32 33 34 |
# File 'lib/beanie/beanie_alert.rb', line 32 def end |
#state ⇒ Object
Returns the value of attribute state.
32 33 34 |
# File 'lib/beanie/beanie_alert.rb', line 32 def state @state end |
#url ⇒ Object
Returns the value of attribute url.
32 33 34 |
# File 'lib/beanie/beanie_alert.rb', line 32 def url @url end |
Instance Method Details
#state_name ⇒ Object
Printable form of the state name
56 57 58 |
# File 'lib/beanie/beanie_alert.rb', line 56 def state_name STATE_NAMES[state][0] end |
#unread? ⇒ Boolean
Is this an unread message?
62 63 64 |
# File 'lib/beanie/beanie_alert.rb', line 62 def unread? state == STATE_NEW end |