class Ehpt::CreateStory

Attributes

story_attrs[R]

Public Class Methods

new(story_attrs) click to toggle source
Calls superclass method Ehpt::Base::new
# File lib/ehpt/create_story.rb, line 5
def initialize(story_attrs)
  @story_attrs = story_attrs
  super
end

Public Instance Methods

call() click to toggle source
# File lib/ehpt/create_story.rb, line 10
def call
  create_story
  prefix_story_name_with_id
rescue StandardError => e
  add_error(eval(e.message)[:body])
end

Private Instance Methods

create_story() click to toggle source
# File lib/ehpt/create_story.rb, line 19
def create_story
  @data = Ehpt.project.create_story(story_attrs)
end
prefix_story_name_with_id() click to toggle source
# File lib/ehpt/create_story.rb, line 23
def prefix_story_name_with_id
  @data.name = [@data.id.to_s.split(//).last(3).join, @data.name].join(' - ')
  @data.save
end