Class: Hashblue::Contact

Inherits:
Model
  • Object
show all
Defined in:
lib/hashblue/contact.rb

Instance Attribute Summary

Attributes inherited from Model

#client

Instance Method Summary collapse

Methods inherited from Model

attribute_methods, #attributes, build, #eql?, #initialize

Constructor Details

This class inherits a constructor from Hashblue::Model

Instance Method Details

#messages(query = {}) ⇒ Object



5
6
7
# File 'lib/hashblue/contact.rb', line 5

def messages(query = {})
  client.load_messages(messages_uri, query)
end

#messages_uriObject



9
10
11
# File 'lib/hashblue/contact.rb', line 9

def messages_uri
  @attributes["messages"]
end

#send_message(content) ⇒ Object



13
14
15
# File 'lib/hashblue/contact.rb', line 13

def send_message(content)
  client.post messages_uri, {}, "message" => {"content" => content}
end