Class: FbGraph::Klass
Direct Known Subclasses
Constant Summary
Constants included from Connections::Settings
Connections::Settings::AVAILABLE_SETTINGS
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#with ⇒ Object
Returns the value of attribute with.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Klass
constructor
A new instance of Klass.
Methods inherited from Page
Methods included from Searchable
search, #search, search_query_param
Methods included from Page::CategoryAttributes
included, #initialize_with_category_specific_attributes
Methods included from Connections::Offers
Methods included from Connections::Videos
Methods included from Connections::Tagged
Methods included from Connections::Tabs
#tab!, #tab?, #tab_for_app, #tabs
Methods included from Connections::Statuses
Methods included from Connections::Settings
#disable!, #enable!, included, #settings
Methods included from Connections::Questions
Methods included from Connections::PromotablePosts
Methods included from Connections::Posts
Methods included from Connections::Picture::Updatable
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Notes
Methods included from Connections::Milestones
Methods included from Connections::Links
Methods included from Connections::Likes
Methods included from Connections::Insights
Methods included from Connections::Groups
Methods included from Connections::Feed
Methods included from Connections::Events
Methods included from Connections::Conversations
Methods included from Connections::Checkins
Methods included from Connections::Blocked
#block!, #blocked, #blocked?, #unblock!
Methods included from Connections::Albums
Methods included from Connections::Admins
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Klass
Returns a new instance of Klass.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fb_graph/klass.rb', line 5 def initialize(identifier, attributes = {}) super @with = [] if attributes[:with] attributes[:with].each do |user| @with << User.new(user[:id], user) end end if attributes[:start_date] year, month = attributes[:start_date].split('-').collect(&:to_i) @start_date = if month.blank? || month == 0 Date.new(year) else Date.new(year, month) end end if attributes[:end_date] year, month = attributes[:end_date].split('-').collect(&:to_i) @end_date = if month.blank? || month == 0 Date.new(year) else Date.new(year, month) end end end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
3 4 5 |
# File 'lib/fb_graph/klass.rb', line 3 def end_date @end_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
3 4 5 |
# File 'lib/fb_graph/klass.rb', line 3 def start_date @start_date end |
#with ⇒ Object
Returns the value of attribute with.
3 4 5 |
# File 'lib/fb_graph/klass.rb', line 3 def with @with end |