Sha256: 4be2d20e910662b34224ccbd089b8e699f24e9e96d871d761401f4c5fd760e73

Contents?: true

Size: 831 Bytes

Versions: 1

Compression:

Stored size: 831 Bytes

Contents

module PivotalTracker
  class Project
    include HappyMapper

    class << self
      def all
        @found = parse(Client.connection['/projects'].get)
      end

      def find(id)
        if @found
          @found.detect { |document| document.id == id }
        else
          parse(Client.connection["/projects/#{id}"].get)
        end
      end
    end

    element :id, Integer
    element :name, String
    element :iteration_length, Integer
    element :week_start_day, String
    element :point_scale, String

    def activities
      @activities ||= Proxy.new(self, Activity)
    end

    def iterations
      @iterations ||= Proxy.new(self, Iteration)
    end

    def stories
      @stories ||= Proxy.new(self, Story)
    end

    def memberships
      @memberships ||= Proxy.new(self, Membership)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pivotal-tracker-0.0.9.1 lib/pivotal-tracker/project.rb