Class: Peaty::Iteration

Inherits:
Base show all
Defined in:
lib/peaty/iteration.rb

Constant Summary

Constants inherited from Base

Base::FILTERS

Instance Attribute Summary

Attributes inherited from Base

#attributes, #connection, #error

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

all, build, #error?, filter_options, find, find_by_id, first, #id, #initialize, #method_missing, #new_record?, parse, #respond_to?, #save, with_connection

Constructor Details

This class inherits a constructor from Peaty::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Peaty::Base

Class Method Details

.collection_path(options = {}) ⇒ Object



15
16
17
# File 'lib/peaty/iteration.rb', line 15

def collection_path(options = {})
  "/projects/%i/iterations" % options[:project_id].to_i
end

.elementObject



12
13
14
# File 'lib/peaty/iteration.rb', line 12

def element
  "iteration"
end

.member_path(group, options = {}) ⇒ Object



18
19
20
# File 'lib/peaty/iteration.rb', line 18

def member_path(group, options = {})
  "/projects/%i/iterations/%s" % [options[:project_id].to_i, group]
end

Instance Method Details

#stories(options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/peaty/iteration.rb', line 5

def stories(options = {})
  Array.wrap(self.attributes["stories"]).map do |story|
    Story.with_connection(self.connection).new(story)
  end
end