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_file = csv_file
  @project = get_project_by(token, project_id)
end

Instance Attribute Details

#csv_fileObject (readonly)

Returns the value of attribute csv_file.



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

def csv_file
  @csv_file
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
20
# File 'lib/ehpt.rb', line 13

def call
  stories_creator = Ehpt::CreateStories.new(csv_file, project)
  stories_creator.call
  puts "Done"
  if stories_creator.error?
    puts "Errors: #{stories_creator.errors}"
  end
end