Class: Hashblue::Message
- Inherits:
-
Model
- Object
- Model
- Hashblue::Message
show all
- Defined in:
- lib/hashblue/message.rb
Instance Attribute Summary
Attributes inherited from Model
#client
Instance Method Summary
collapse
Methods inherited from Model
attribute_methods, #attributes, build, #eql?, #initialize
Instance Method Details
5
6
7
|
# File 'lib/hashblue/message.rb', line 5
def contact
@contact ||= Contact.build(client, @attributes["contact"])
end
|
#delete! ⇒ Object
17
18
19
|
# File 'lib/hashblue/message.rb', line 17
def delete!
client.delete(uri)
end
|
#favourite! ⇒ Object
21
22
23
24
25
|
# File 'lib/hashblue/message.rb', line 21
def favourite!
client.put(uri + '/favourite', {}, {})
@attributes['favourite'] = true
true
end
|
#favourite? ⇒ Boolean
13
14
15
|
# File 'lib/hashblue/message.rb', line 13
def favourite?
@attributes["favourite"]
end
|
#sent? ⇒ Boolean
9
10
11
|
# File 'lib/hashblue/message.rb', line 9
def sent?
@attributes["sent"]
end
|
#unfavourite! ⇒ Object
27
28
29
30
31
|
# File 'lib/hashblue/message.rb', line 27
def unfavourite!
client.delete(uri + '/favourite')
@attributes['favourite'] = false
true
end
|