Class: GSGraph::Klass

Inherits:
Page show all
Defined in:
lib/gs_graph/klass.rb

Direct Known Subclasses

Project

Constant Summary

Constants included from Connections::Settings

Connections::Settings::AVAILABLE_SETTINGS

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

Methods inherited from Page

#get_access_token

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

#offer!, #offers

Methods included from Connections::Videos

#video!, #videos

Methods included from Connections::Tagged

#tagged

Methods included from Connections::Tabs

#tab!, #tab?, #tabs

Methods included from Connections::Statuses

#statuses

Methods included from Connections::Settings

#disable!, #enable!, included, #settings

Methods included from Connections::Questions

#question!, #questions

Methods included from Connections::PromotablePosts

#promotable_posts

Methods included from Connections::Posts

#posts

Methods included from Connections::Picture::Updatable

#picture!

Methods included from Connections::Picture

#picture

Methods included from Connections::Photos

#photo!, #photos

Methods included from Connections::Notes

#note!, #notes

Methods included from Connections::Milestones

#milestone!, #milestones

Methods included from Connections::Links

#link!, #links

Methods included from Connections::Likes

#likes

Methods included from Connections::Insights

#insights

Methods included from Connections::Groups

#groups

Methods included from Connections::Feed

#feed, #feed!

Methods included from Connections::Events

#event!, #events

Methods included from Connections::Conversations

#conversations

Methods included from Connections::Checkins

#checkin!, #checkins

Methods included from Connections::Blocked

#block!, #blocked, #blocked?, #unblock!

Methods included from Connections::Albums

#album!, #albums

Methods included from Connections::Admins

#admin?

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/gs_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_dateObject

Returns the value of attribute end_date.



3
4
5
# File 'lib/gs_graph/klass.rb', line 3

def end_date
  @end_date
end

#start_dateObject

Returns the value of attribute start_date.



3
4
5
# File 'lib/gs_graph/klass.rb', line 3

def start_date
  @start_date
end

#withObject

Returns the value of attribute with.



3
4
5
# File 'lib/gs_graph/klass.rb', line 3

def with
  @with
end