Module: Croudia::API::Statuses

Included in:
Client
Defined in:
lib/croudia/api/statuses.rb

Instance Method Summary collapse

Instance Method Details

#destroy_status(status, params = {}) ⇒ Croudia::Status

Destroy a status

Parameters:

  • status (String, Integer, Croudia::Status)

    Status to delete

  • params (Hash) (defaults to: {})

    Additional query parameters

Options Hash (params):

  • :include_entities (String)

    Set false to exclude entities

  • :trim_user (String)

    Set true to return compact user objects

Returns:

See Also:



63
64
65
66
67
# File 'lib/croudia/api/statuses.rb', line 63

def destroy_status(status, params={})
  status_id = get_id(status)
  resp = post("/statuses/destroy/#{status_id}.json", params)
  Croudia::Status.new(resp)
end

#share(id, status, params = {}) ⇒ Croudia::Status #share(params = {}) ⇒ Croudia::Status

Share (formerly reply with quote) a status

Overloads:

  • #share(id, status, params = {}) ⇒ Croudia::Status

    Parameters:

    • id (String, Integer, Croudia::Status)

      Post to share

    • status (String)

      Status text

    • params (Hash) (defaults to: {})

      Additional query parameters

    Options Hash (params):

    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

  • #share(params = {}) ⇒ Croudia::Status

    Parameters:

    • params (Hash) (defaults to: {})

      Query parameters

    Options Hash (params):

    • :id (String, Integer, Croudia::Status)

      Post to share

    • :status (String)

      Status text

    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



113
114
115
116
117
118
# File 'lib/croudia/api/statuses.rb', line 113

def share(id, status={}, params={})
  merge_id!(params, id)
  merge_text!(params, status)
  resp = post('/statuses/share.json', params)
  Croudia::Status.new(resp)
end

#share_with_media(id, status, media, params = {}) ⇒ Croudia::Status #share_with_media(params = {}) ⇒ Croudia::Status

Note:

Currently only PNG, JPG, and GIF are supported

Share (formerly reply with quote) a status with media

Overloads:

  • #share_with_media(id, status, media, params = {}) ⇒ Croudia::Status

    Parameters:

    • id (String, Integer, Croudia::Status)

      Post to share

    • status (String)

      Status text

    • media (File, #to_io)

      Image to upload with

    • params (Hash) (defaults to: {})

      Additional query parameters

    Options Hash (params):

    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

  • #share_with_media(params = {}) ⇒ Croudia::Status

    Parameters:

    • params (Hash) (defaults to: {})

      Query parameters

    Options Hash (params):

    • :id (String, Integer, Croudia::Status)

      Post to share

    • :include_entities (String)

      Set false to exclude entities

    • :media (File, #to_io)

      Image to upload with

    • :status (String)

      Status text

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



139
140
141
142
143
144
145
# File 'lib/croudia/api/statuses.rb', line 139

def share_with_media(id, status={}, media={}, params={})
  merge_id!(params, id)
  merge_text!(params, status)
  merge_file!(params, media, :media)
  resp = post('/statuses/share_with_media.json', params)
  Croudia::Status.new(resp)
end

#spread(status, params = {}) ⇒ Croudia::Status

Spread a status

Parameters:

  • status (String, Integer, Croudia::Status)

    Status to spread

  • params (Hash) (defaults to: {})

    Additional query parameters

Options Hash (params):

  • :include_entities (String)

    Set false to exclude entities

  • :trim_user (String)

    Set true to return compact user objects

Returns:

See Also:



91
92
93
94
95
# File 'lib/croudia/api/statuses.rb', line 91

def spread(status, params={})
  status_id = get_id(status)
  resp = post("/statuses/spread/#{status_id}.json", params)
  Croudia::Status.new(resp)
end

#status(status, params = {}) ⇒ Croudia::Status

Retrieve a status

Parameters:

  • status (String, Integer, Croudia::Status)

    Status to get

  • params (Hash) (defaults to: {})

    Additional query parameters

Options Hash (params):

  • :include_entities (String)

    Set false to exclude entities

  • :trim_user (String)

    Set true to return compact user objects

Returns:

See Also:



77
78
79
80
81
# File 'lib/croudia/api/statuses.rb', line 77

def status(status, params={})
  status_id = get_id(status)
  resp = get("/statuses/show/#{status_id}.json", params)
  Croudia::Status.new(resp)
end

#update(status, params = {}) ⇒ Croudia::Status #update(params = {}) ⇒ Croudia::Status

Update status

Overloads:

  • #update(status, params = {}) ⇒ Croudia::Status

    Parameters:

    • status (String)

      Status text

    • params (Hash) (defaults to: {})

      Additional query parameters

    Options Hash (params):

    • :in_reply_to_status_id (String, Integer)
    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

  • #update(params = {}) ⇒ Croudia::Status

    Parameters:

    • params (Hash) (defaults to: {})

      Query parameters

    Options Hash (params):

    • :in_reply_to_status_id (String, Integer)
    • :include_entities (String)

      Set false to exclude entities

    • :status (String)

      Status text

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



22
23
24
25
26
27
# File 'lib/croudia/api/statuses.rb', line 22

def update(status, params={})
  merge_text!(params, status)

  resp = post('/statuses/update.json', params)
  Croudia::Status.new(resp)
end

#update_with_media(status, media, params = {}) ⇒ Croudia::Status #update_with_media(params = {}) ⇒ Croudia::Status

Note:

Currently only PNG, JPG, and GIF are supported

Update status with media

Overloads:

  • #update_with_media(status, media, params = {}) ⇒ Croudia::Status

    Parameters:

    • status (String)

      Status text

    • media (File, #to_io)

      Image to upload with

    • params (Hash) (defaults to: {})

      Additional query parameters

    Options Hash (params):

    • :in_reply_to_status_id (String, Integer)
    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

  • #update_with_media(params = {}) ⇒ Croudia::Status

    Parameters:

    • params (Hash) (defaults to: {})

      Query parameters

    Options Hash (params):

    • :in_reply_to_status_id (String, Integer)
    • :include_entities (String)

      Set false to exclude entities

    • :media (File, #to_io)

      Image to upload with

    • :status (String)

      Status text

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



48
49
50
51
52
53
# File 'lib/croudia/api/statuses.rb', line 48

def update_with_media(status, media={}, params={})
  merge_text!(params, status)
  merge_file!(params, media, :media)
  resp = post('/statuses/update_with_media.json', params)
  Croudia::Status.new(resp)
end