Class: Trajectory::Ideas
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Trajectory::Ideas
- Defined in:
- lib/trajectory/domain/ideas.rb
Class Method Summary collapse
-
.from_json(project, json_attributes) ⇒ Object
Create a new collection of Idea from a JSON array of attributes from trajectory API.
Instance Method Summary collapse
-
#initialize(*ideas) ⇒ Ideas
constructor
Creates a new collection of Idea.
Constructor Details
#initialize(*ideas) ⇒ Ideas
Creates a new collection of Trajectory::Idea
8 9 10 |
# File 'lib/trajectory/domain/ideas.rb', line 8 def initialize(*ideas) super(ideas) end |
Class Method Details
.from_json(project, json_attributes) ⇒ Object
Create a new collection of Trajectory::Idea from a JSON array of attributes from trajectory API
16 17 18 19 20 21 |
# File 'lib/trajectory/domain/ideas.rb', line 16 def self.from_json(project, json_attributes) new(*json_attributes.map do |attributes| attributes = attributes.symbolize_keys!.merge({project_id: project.id}) Idea.new(attributes) end) end |