Repository URL to install this package:
|
Version:
0.9.12 ▾
|
module ActionSprout
module Facebook
class Page
PAGE_FIELDS = 'name,category,description,about,fan_count'.freeze
def initialize(id, api: nil, fields: PAGE_FIELDS)
@id = id
raise ArgumentError.new('"id" must be a non-empty string'.freeze) unless id.present?
@api = api || API.new
@fields = fields
end
def data
page_data_response.parsed_response
end
private
attr_reader :id, :api, :fields
def page_data_response
@_page_data_response ||= api.get(id, query: page_data_query)
end
def page_data_query
{ fields: fields }
end
end
end
end