Sha256: 72e4605efe876c9293ff7fb62ae28ecd72951cc789d381287e274b83ab25ea27

Contents?: true

Size: 651 Bytes

Versions: 13

Compression:

Stored size: 651 Bytes

Contents

module FbGraph
  class Project < Page
    attr_accessor :start_date, :end_date

    def initialize(identifier, attributes = {})
      super
      if attributes[:start_date]
        year, month = attributes[:start_date].split('-').collect(&:to_i)
        @start_date = if month.blank? || month == 0
          Date.new(year)
        else
          Date.new(year, month)
        end
      end
      if attributes[:end_date]
        year, month = attributes[:end_date].split('-').collect(&:to_i)
        @end_date = if month.blank? || month == 0
          Date.new(year)
        else
          Date.new(year, month)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fb_graph-1.6.1 lib/fb_graph/project.rb
fb_graph-1.6.0 lib/fb_graph/project.rb
fb_graph-1.5.5 lib/fb_graph/project.rb
fb_graph-1.5.4 lib/fb_graph/project.rb
fb_graph-1.5.3 lib/fb_graph/project.rb
fb_graph-1.5.2 lib/fb_graph/project.rb
fb_graph-1.5.1 lib/fb_graph/project.rb
fb_graph-1.5.0 lib/fb_graph/project.rb
fb_graph-1.4.1 lib/fb_graph/project.rb
fb_graph-1.4.0 lib/fb_graph/project.rb
fb_graph-1.3.9 lib/fb_graph/project.rb
fb_graph-1.3.8 lib/fb_graph/project.rb
fb_graph-1.3.7 lib/fb_graph/project.rb