Class: Ehpt
- Inherits:
-
Object
- Object
- Ehpt
- 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
-
#csv_content ⇒ Object
readonly
Returns the value of attribute csv_content.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(csv_file, token, project_id) ⇒ Ehpt
constructor
A new instance of Ehpt.
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_content ⇒ Object (readonly)
Returns the value of attribute csv_content.
6 7 8 |
# File 'lib/ehpt.rb', line 6 def csv_content @csv_content end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
6 7 8 |
# File 'lib/ehpt.rb', line 6 def project @project end |
Instance Method Details
#call ⇒ Object
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 |