Module: Biovision::Components::Base::ComponentStories
- Defined in:
- app/lib/biovision/components/base/component_stories.rb
Overview
Methods for handling component stories
Instance Method Summary collapse
- #perform_story(story_slug, story_parameters, entity = nil) ⇒ Object
- #story(story_slug, entity = nil) ⇒ Object
- #story_class(story_slug) ⇒ Object
Instance Method Details
#perform_story(story_slug, story_parameters, entity = nil) ⇒ Object
24 25 26 |
# File 'app/lib/biovision/components/base/component_stories.rb', line 24 def perform_story(story_slug, story_parameters, entity = nil) story(story_slug, entity).perform(story_parameters) end |
#story(story_slug, entity = nil) ⇒ Object
17 18 19 |
# File 'app/lib/biovision/components/base/component_stories.rb', line 17 def story(story_slug, entity = nil) story_class(story_slug).new(self, entity) end |
#story_class(story_slug) ⇒ Object
9 10 11 12 13 |
# File 'app/lib/biovision/components/base/component_stories.rb', line 9 def story_class(story_slug) namespace = "biovision/components/#{self.class.slug}" handler_name = "#{namespace}/stories/#{story_slug}_story".classify handler_name.safe_constantize || Biovision::Stories::ComponentStory end |