class Postwill::Providers::Facebook

Public Class Methods

new(options) click to toggle source
# File lib/postwill/providers/facebook.rb, line 4
def initialize(options)
  @client ||= ::Koala::Facebook::API.new(options[:access_token])
end

Private Instance Methods

post(options) click to toggle source
# File lib/postwill/providers/facebook.rb, line 10
def post(options)
  image = options[:image]
  text = options[:text]

  if image
    client.put_picture(image, { message: text })
  else
    client.put_connections('me', 'feed', message: text)
  end
end