Class: Ehpt

Inherits:
Object
  • Object
show all
Defined in:
lib/ehpt.rb,
lib/ehpt/base.rb,
lib/ehpt/get_project.rb,
lib/ehpt/create_story.rb,
lib/ehpt/create_stories.rb

Defined Under Namespace

Classes: Base, CreateStories, CreateStory, GetProject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(csv_file, token, project_id) ⇒ Ehpt

Returns a new instance of Ehpt.



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

def initialize(csv_file, token, project_id)
  @csv_content = File.read(csv_file)
  @project = get_project(token, project_id)
end

Instance Attribute Details

#csv_contentObject (readonly)

Returns the value of attribute csv_content.



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

def csv_content
  @csv_content
end

#projectObject (readonly)

Returns the value of attribute project.



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

def project
  @project
end

Instance Method Details

#callObject



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

def call
  stories_creator = Ehpt::CreateStories.new(csv_content, project)
  stories_creator.call
  if stories_creator.error?
    raise StandardError, stories_creator.errors
  end
end