Sha256: cee1f000fc58795521576d3cdc16394cff880f0498224fa000553b78d6d52050

Contents?: true

Size: 448 Bytes

Versions: 14

Compression:

Stored size: 448 Bytes

Contents

module FbGraph2
  class TaggedProfile < Node
    register_attributes(
      raw: [:id, :name, :type, :offset, :length],
      custom: [:object]
    )

    def initialize(id, attributes = {})
      super
      self.object = klass.new self.id
    end

    def klass
      klass = case self.type
      when 'user'
        User
      when 'page'
        Page
      when 'group'
        Group
      when 'event'
        Event
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fb_graph2-0.4.4 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.4.3 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.4.1 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.4.0 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.3.2 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.3.1 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.3.0 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.2.0 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.1.3 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.1.2 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.1.1 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.1.0 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.0.11 lib/fb_graph2/tagged_profile.rb
fb_graph2-0.0.10 lib/fb_graph2/tagged_profile.rb