Method: Facebooker::User#prepare_publish_to_options

Defined in:
lib/facebooker/models/user.rb

#prepare_publish_to_options(target, options) ⇒ Object

Prepares options for the stream.publish



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/facebooker/models/user.rb', line 152

def prepare_publish_to_options(target, options)
  opts = {:uid          => self.id,
          :target_id    => target.id,
          :message      => options[:message]}

  if a = options[:attachment]
    opts[:attachment] = convert_attachment_to_json(a)
  end
  if (links = options[:action_links] && Facebooker.json_encode(options[:action_links]))
    opts[:action_links] = links
  end
  unless options[:uid].nil?
    opts[:uid] = options[:uid]
  end
  if options[:post_as_page]
    opts.delete(:target_id)
  end
  opts
end