Class: Pageflow::StorylineScaffold
- Inherits:
-
Object
- Object
- Pageflow::StorylineScaffold
- Defined in:
- app/models/pageflow/storyline_scaffold.rb
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(_ = {}) ⇒ Object
- #build ⇒ Object
-
#initialize(storyline, options) ⇒ StorylineScaffold
constructor
A new instance of StorylineScaffold.
- #to_model ⇒ Object
Constructor Details
#initialize(storyline, options) ⇒ StorylineScaffold
Returns a new instance of StorylineScaffold.
3 4 5 6 |
# File 'app/models/pageflow/storyline_scaffold.rb', line 3 def initialize(storyline, ) @storyline = storyline @options = end |
Class Method Details
.build(revision, attributes, options) ⇒ Object
23 24 25 |
# File 'app/models/pageflow/storyline_scaffold.rb', line 23 def self.build(revision, attributes, ) new(revision.storylines.build(attributes), ).build end |
Instance Method Details
#as_json(_ = {}) ⇒ Object
15 16 17 |
# File 'app/models/pageflow/storyline_scaffold.rb', line 15 def as_json(_ = {}) @chapter_scaffold.as_json.merge(storyline: @storyline) end |
#build ⇒ Object
10 11 12 13 |
# File 'app/models/pageflow/storyline_scaffold.rb', line 10 def build @chapter_scaffold = ChapterScaffold.build(@storyline, {}, @options) self end |
#to_model ⇒ Object
19 20 21 |
# File 'app/models/pageflow/storyline_scaffold.rb', line 19 def to_model @storyline end |