Class: ActionView::Storybook::Dsl::StoryDsl
- Inherits:
-
Object
- Object
- ActionView::Storybook::Dsl::StoryDsl
- Defined in:
- lib/action_view/storybook/dsl/story_dsl.rb
Class Method Summary collapse
Instance Method Summary collapse
- #content(&block) ⇒ Object
- #controls(&block) ⇒ Object
- #layout(layout) ⇒ Object
- #parameters(**params) ⇒ Object
Class Method Details
.evaluate!(story_config, &block) ⇒ Object
7 8 9 |
# File 'lib/action_view/storybook/dsl/story_dsl.rb', line 7 def self.evaluate!(story_config, &block) new(story_config).instance_eval(&block) end |
Instance Method Details
#content(&block) ⇒ Object
25 26 27 |
# File 'lib/action_view/storybook/dsl/story_dsl.rb', line 25 def content(&block) @story_config.content_block = block end |
#controls(&block) ⇒ Object
15 16 17 18 19 |
# File 'lib/action_view/storybook/dsl/story_dsl.rb', line 15 def controls(&block) controls_dsl = ControlsDsl.new(story_config) controls_dsl.instance_eval(&block) @story_config.controls = controls_dsl.controls end |
#layout(layout) ⇒ Object
21 22 23 |
# File 'lib/action_view/storybook/dsl/story_dsl.rb', line 21 def layout(layout) @story_config.layout = layout end |
#parameters(**params) ⇒ Object
11 12 13 |
# File 'lib/action_view/storybook/dsl/story_dsl.rb', line 11 def parameters(**params) @story_config.parameters = params end |