Class: Coop::Status
- Defined in:
- lib/coop/api_object/status.rb
Instance Method Summary collapse
-
#post!(message) ⇒ Object
Public: Post a status update to a group.
-
#post_as_cobot!(message, api_key) ⇒ Object
Public: Post a status update to a group as Cobot.
-
#recent ⇒ Object
Public: Get a group’s 50 most recent tweets.
-
#where(options = {}) ⇒ Object
Public: A poor man’s Arel for querying the status API.
Methods inherited from APIObject
Instance Method Details
#post!(message) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/coop/api_object/status.rb', line 25 def post!() Coop.post( "/groups/#{self.group_id}/statuses", query: { status: }, headers: { "Accept" => "application/xml" } ).headers["Location"] end |
#post_as_cobot!(message, api_key) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/coop/api_object/status.rb', line 44 def post_as_cobot!(, api_key) Coop.post( "/groups/#{self.group_id}/statuses", query: { status: , key: api_key }, headers: { "Accept" => "application/xml" }, basic_auth: nil ).headers["Location"] end |
#recent ⇒ Object
11 12 13 |
# File 'lib/coop/api_object/status.rb', line 11 def recent Coop.get_parsed("/groups/#{self.group_id}/statuses") end |
#where(options = {}) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/coop/api_object/status.rb', line 64 def where( = {}) if [:user_id] && [:date] where_user_and_date([:user_id], [:date]) elsif [:user_id] where_user([:user_id]) elsif [:date] where_date([:date]) else recent end end |