Class: FbGraph::Education

Inherits:
Object
  • Object
show all
Includes:
Comparison
Defined in:
lib/fb_graph/education.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Comparison

#==

Constructor Details

#initialize(attributes = {}) ⇒ Education

Returns a new instance of Education.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fb_graph/education.rb', line 7

def initialize(attributes = {})
  if (school = attributes[:school])
    @school = Page.new(school.delete(:id), school)
  end
  if (degree = attributes[:degree])
    @degree = Page.new(degree.delete(:id), degree)
  end
  if (year = attributes[:year])
    @year = Page.new(year.delete(:id), year)
  end
  @concentration = []
  if attributes[:concentration]
    attributes[:concentration].each do |concentration|
      @concentration << Page.new(concentration.delete(:id), concentration)
    end
  end
  @classes = []
  if attributes[:classes]
    attributes[:classes].each do |klass|
      @classes << Page.new(klass.delete(:id), klass)
    end
  end
  @type = attributes[:type]
end

Instance Attribute Details

#classesObject

Returns the value of attribute classes.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def classes
  @classes
end

#concentrationObject

Returns the value of attribute concentration.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def concentration
  @concentration
end

#degreeObject

Returns the value of attribute degree.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def degree
  @degree
end

#schoolObject

Returns the value of attribute school.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def school
  @school
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def type
  @type
end

#yearObject

Returns the value of attribute year.



5
6
7
# File 'lib/fb_graph/education.rb', line 5

def year
  @year
end