Class: Facebooker::Feed::TemplatizedAction
- Inherits:
-
ActionBase
- Object
- ActionBase
- Facebooker::Feed::TemplatizedAction
- Defined in:
- lib/facebooker/feed.rb
Overview
Representation of a templatized action to be published into a user’s news feed
Instance Attribute Summary collapse
-
#body_data ⇒ Object
Returns the value of attribute body_data.
-
#body_general ⇒ Object
Returns the value of attribute body_general.
-
#body_template ⇒ Object
Returns the value of attribute body_template.
-
#page_actor_id ⇒ Object
Returns the value of attribute page_actor_id.
-
#target_ids ⇒ Object
Returns the value of attribute target_ids.
-
#title_data ⇒ Object
Returns the value of attribute title_data.
-
#title_template ⇒ Object
Returns the value of attribute title_template.
Instance Method Summary collapse
Methods inherited from ActionBase
Instance Attribute Details
#body_data ⇒ Object
Returns the value of attribute body_data.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def body_data @body_data end |
#body_general ⇒ Object
Returns the value of attribute body_general.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def body_general @body_general end |
#body_template ⇒ Object
Returns the value of attribute body_template.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def body_template @body_template end |
#page_actor_id ⇒ Object
Returns the value of attribute page_actor_id.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def page_actor_id @page_actor_id end |
#target_ids ⇒ Object
Returns the value of attribute target_ids.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def target_ids @target_ids end |
#title_data ⇒ Object
Returns the value of attribute title_data.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def title_data @title_data end |
#title_template ⇒ Object
Returns the value of attribute title_template.
39 40 41 |
# File 'lib/facebooker/feed.rb', line 39 def title_template @title_template end |
Instance Method Details
#convert_json(hash_or_string) ⇒ Object
52 53 54 |
# File 'lib/facebooker/feed.rb', line 52 def convert_json(hash_or_string) (hash_or_string.is_a?(Hash) and hash_or_string.respond_to?(:to_json)) ? hash_or_string.to_json : hash_or_string end |
#to_params ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/facebooker/feed.rb', line 41 def to_params raise "Must set title_template" if self.title_template.nil? { :page_actor_id => page_actor_id, :title_template => title_template, :title_data => convert_json(title_data), :body_template => body_template, :body_data => convert_json(body_data), :body_general => body_general, :target_ids => target_ids }.merge image_params end |