Sha256: e36ff42e7ebd1f544e674fc7742361727ff9e355324314388bc9bc2ce1f614c5

Contents?: true

Size: 1.35 KB

Versions: 13

Compression:

Stored size: 1.35 KB

Contents

module FbGraph
  class Event < Node
    include Connections::Feed
    include Connections::Noreply
    include Connections::Maybe
    include Connections::Invited
    include Connections::Attending
    include Connections::Declined
    include Connections::Picture
    include Connections::Videos
    extend Searchable

    attr_accessor :owner, :name, :description, :start_time, :end_time, :location, :venue, :privacy, :updated_time

    def initialize(identifier, attributes = {})
      super
      if (owner = attributes[:owner])
        @owner = User.new(owner[:id], owner)
      end
      @name        = attributes[:name]
      @description = attributes[:description]
      @location    = attributes[:location]
      @privacy     = attributes[:privacy]
      if (start_time = attributes[:start_time])
        @start_time = case start_time
        when String
          Time.parse(start_time)
        when Integer
          Time.at(start_time)
        end
      end
      if (end_time = attributes[:end_time])
        @end_time = case end_time
        when String
          Time.parse(end_time)
        when Integer
          Time.at(end_time)
        end
      end
      if attributes[:venue]
        @venue = Venue.new(attributes[:venue])
      end
      if attributes[:updated_time]
        @updated_time = Time.parse(attributes[:updated_time]).utc
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fb_graph-2.4.7 lib/fb_graph/event.rb
fb_graph-2.4.6 lib/fb_graph/event.rb
fb_graph-2.4.4 lib/fb_graph/event.rb
fb_graph-2.4.3 lib/fb_graph/event.rb
fb_graph-2.4.2 lib/fb_graph/event.rb
fb_graph-2.4.1 lib/fb_graph/event.rb
fb_graph-2.4.0 lib/fb_graph/event.rb
fb_graph-2.3.2 lib/fb_graph/event.rb
fb_graph-2.3.1 lib/fb_graph/event.rb
fb_graph-2.3.0 lib/fb_graph/event.rb
fb_graph-2.2.6 lib/fb_graph/event.rb
fb_graph-2.2.5 lib/fb_graph/event.rb
fb_graph-2.2.4 lib/fb_graph/event.rb