Sha256: 1d8b16416b49d4cc2c05c6e29addb7213e807d3b2785549e94c36b8af4eaac76

Contents?: true

Size: 1.14 KB

Versions: 26

Compression:

Stored size: 1.14 KB

Contents

module FbGraph
  class Offer < Node
    extend Searchable

    ATTRS = [ :from,
              :title,
              :created_time,
              :expiration_time,
              :terms,
              :image_url,
              :coupon_type,
              :claim_limit,
              :redemption_link,
              :redemption_code]

    attr_accessor *ATTRS

    def initialize(identifier, attributes = {})
      super

      @from = Page.new(attributes[:from][:id], attributes[:from]) if attributes[:from]
      @title = attributes[:title]
      @created_time = Time.parse(attributes[:created_time]).utc if attributes[:created_time]
      @expiration_time = Time.parse(attributes[:expiration_time]).utc
      @terms = attributes[:terms] if attributes[:terms]
      @image_url = attributes[:image_url] if attributes[:image_url]
      @coupon_type = attributes[:coupon_type] if attributes[:coupon_type]
      @claim_limit = attributes[:claim_limit] if attributes[:claim_limit]
      @redemption_link = attributes[:redemption_link] if attributes[:redemption_link]
      @redemption_code = attributes[:redemption_code] if attributes[:redemption_code]
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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