Sha256: cd6debe24b2fba2a079e5b37d0823f6072de736c6aff46622db0b68bd3148c1e

Contents?: true

Size: 683 Bytes

Versions: 101

Compression:

Stored size: 683 Bytes

Contents

module FbGraph
  class Tag
    include Comparison
    include Serialization

    attr_accessor :user, :name, :x, :y, :created_time

    def initialize(attributes = {})
      @x = attributes[:x]
      @y = attributes[:y]
      if attributes[:created_time]
        @created_time = Time.parse(attributes[:created_time]).utc
      end
      if attributes[:id].present?
        @user = User.new(attributes[:id], attributes)
      end
      @name = attributes[:name]
    end

    def to_hash(options = {})
      hash = {
        :tag_text => self.name,
        :x => self.x,
        :y => self.y
      }
      hash[:tag_uid] = self.user.identifier if self.user
      hash
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
fb_graph-2.7.17 lib/fb_graph/tag.rb
fb_graph-2.7.16 lib/fb_graph/tag.rb
fb_graph-2.7.15 lib/fb_graph/tag.rb
fb_graph-2.7.14 lib/fb_graph/tag.rb
fb_graph-2.7.13 lib/fb_graph/tag.rb
fb_graph-2.7.12 lib/fb_graph/tag.rb
fb_graph-2.7.11 lib/fb_graph/tag.rb
fb_graph-2.7.10 lib/fb_graph/tag.rb
fb_graph-2.7.9 lib/fb_graph/tag.rb
fb_graph-2.7.8 lib/fb_graph/tag.rb
fb_graph-2.7.7 lib/fb_graph/tag.rb
fb_graph-2.7.6 lib/fb_graph/tag.rb
fb_graph-2.7.5 lib/fb_graph/tag.rb
fb_graph-2.7.4 lib/fb_graph/tag.rb
fb_graph-2.7.3 lib/fb_graph/tag.rb
fb_graph-2.7.2 lib/fb_graph/tag.rb
fb_graph-2.7.1 lib/fb_graph/tag.rb
fb_graph-2.7.0 lib/fb_graph/tag.rb
fb_graph-2.6.7 lib/fb_graph/tag.rb
fb_graph-2.6.6 lib/fb_graph/tag.rb