Class: Sifterology::ProjectFactory
- Defined in:
- lib/sifterology/factories/project_factory.rb
Instance Attribute Summary
Attributes inherited from Resource
#factory, #last_request, #session
Instance Method Summary collapse
Methods inherited from Resource
#attributes=, #delete, #get, #initialize, #local_attributes=, #post, #put, sifter_attrs
Constructor Details
This class inherits a constructor from Sifterology::Resource
Instance Method Details
#build(attributes) ⇒ Object
17 18 19 20 21 |
# File 'lib/sifterology/factories/project_factory.rb', line 17 def build(attributes) Project.new(session, self).tap do |p| p.attributes = attributes end end |
#entity_base ⇒ Object
5 6 7 |
# File 'lib/sifterology/factories/project_factory.rb', line 5 def entity_base '/api/projects' end |
#find_all ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/sifterology/factories/project_factory.rb', line 9 def find_all [].tap do |arr| get("#{ entity_base }/?all=true")['projects'].each do |project_attrs| arr << build(project_attrs) end end end |