Sha256: 82bf41a041e9ef6af42ad02a674c314ad8b458e02c482a469c34266c6cfd5f43

Contents?: true

Size: 919 Bytes

Versions: 18

Compression:

Stored size: 919 Bytes

Contents

module FbGraph
  class Education
    include Comparison

    attr_accessor :school, :degree, :year, :concentration, :classes, :type

    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
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fb_graph-1.6.1 lib/fb_graph/education.rb
fb_graph-1.6.0 lib/fb_graph/education.rb
fb_graph-1.5.5 lib/fb_graph/education.rb
fb_graph-1.5.4 lib/fb_graph/education.rb
fb_graph-1.5.3 lib/fb_graph/education.rb
fb_graph-1.5.2 lib/fb_graph/education.rb
fb_graph-1.5.1 lib/fb_graph/education.rb
fb_graph-1.5.0 lib/fb_graph/education.rb
fb_graph-1.4.1 lib/fb_graph/education.rb
fb_graph-1.4.0 lib/fb_graph/education.rb
fb_graph-1.3.9 lib/fb_graph/education.rb
fb_graph-1.3.8 lib/fb_graph/education.rb
fb_graph-1.3.7 lib/fb_graph/education.rb
fb_graph-1.3.6 lib/fb_graph/education.rb
fb_graph-1.3.5 lib/fb_graph/education.rb
fb_graph-1.3.4 lib/fb_graph/education.rb
fb_graph-1.3.3 lib/fb_graph/education.rb
fb_graph-1.3.2 lib/fb_graph/education.rb