Sha256: 3b0cd0460bc4511e05671dbf381f3d12a428c256e4b2a62acf977530ea5b16f0

Contents?: true

Size: 819 Bytes

Versions: 8

Compression:

Stored size: 819 Bytes

Contents

module Peaty
  
  class Story < Base
    
    def story_type
      self.attributes["story_type"].to_sym if story_type?
    end
    alias type story_type
    
    # chores, bugs, releases may or may not have estimates
    def estimate
      self.attributes["estimate"].to_i
    end
    
    def project
      Project.with_connection(self.class.connection).find(self.project_id)
    end
    
    class << self
      def element
        "story"
      end
      def collection_path(options = {})
        "/projects/%i/stories" % options[:project_id].to_i
      end
      def member_path(id, options = {})
        "/projects/%i/stories/%i" % [options[:project_id].to_i, id]
      end
      
      ### Filters
      
      def releases(options = {})
        self.filter(:type => :release)
      end
    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
peaty-0.4.7 lib/peaty/story.rb
peaty-0.4.6 lib/peaty/story.rb
peaty-0.4.5 lib/peaty/story.rb
peaty-0.4.4 lib/peaty/story.rb
peaty-0.4.3 lib/peaty/story.rb
peaty-0.4.2 lib/peaty/story.rb
peaty-0.4.1 lib/peaty/story.rb
peaty-0.4.0 lib/peaty/story.rb