Class: Mondo::FeedItem

Inherits:
Resource show all
Defined in:
lib/api/mondo/feed_item.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#client, #raw_data

Instance Method Summary collapse

Methods inherited from Resource

boolean_accessor, boolean_reader, date_accessor, date_writer, #initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Mondo::Resource

Instance Attribute Details

#background_colorObject

Returns the value of attribute background_color.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def background_color
  @background_color
end

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def body
  @body
end

#image_urlObject

Returns the value of attribute image_url.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def image_url
  @image_url
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def title
  @title
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def type
  @type
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/api/mondo/feed_item.rb', line 4

def url
  @url
end

Instance Method Details

#create_paramsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/api/mondo/feed_item.rb', line 17

def create_params
  {
    account_id: self.client.,
    type: "basic",
    url: self.url,
    params: {
      title: self.title,
      image_url: self.image_url,
      background_color: self.background_color,
      body: self.body
    }
  }
end

#saveObject

temporary fix until the API accepts JSON data in the request body



13
14
15
# File 'lib/api/mondo/feed_item.rb', line 13

def save
  self.client.api_post("/feed", self.create_params)
end