Class: Ehpt::CreateStory

Inherits:
Base
  • Object
show all
Defined in:
lib/ehpt/create_story.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#data, #errors

Instance Method Summary collapse

Methods inherited from Base

call, #error?, #success?

Constructor Details

#initialize(project, story_attrs) ⇒ CreateStory

Returns a new instance of CreateStory.



7
8
9
10
11
# File 'lib/ehpt/create_story.rb', line 7

def initialize(project, story_attrs)
  @project = project
  @story_attrs = story_attrs
  super
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



5
6
7
# File 'lib/ehpt/create_story.rb', line 5

def project
  @project
end

#story_attrsObject (readonly)

Returns the value of attribute story_attrs.



5
6
7
# File 'lib/ehpt/create_story.rb', line 5

def story_attrs
  @story_attrs
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
# File 'lib/ehpt/create_story.rb', line 13

def call
  create_story
  prefix_story_name_with_id
  puts "Created story: #{@story.name}"
rescue StandardError => e
  errors << e.message
end