Class: Ehpt::CreateStories

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

Constant Summary collapse

ARRAY_TYPE_ATTRIBUTES =
%w[ labels tasks pull_requests branches blockers comments reviews ]
INT_ARRAY_TYPE_ATTRIBUTES =
%w[ owner_ids label_ids follower_ids ]
INT_TYPE_ATTRIBUTES =
%w[ project_id requested_by_id before_id after_id integration_id ]
FLOAT_TYPE_ATTRIBUES =
%w[ estimate ]

Instance Attribute Summary collapse

Attributes inherited from Base

#data, #errors

Instance Method Summary collapse

Methods inherited from Base

call, #error?, #success?

Constructor Details

#initialize(csv_file, project) ⇒ CreateStories

Returns a new instance of CreateStories.



17
18
19
20
21
# File 'lib/ehpt/create_stories.rb', line 17

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

Instance Attribute Details

#csv_fileObject (readonly)

Returns the value of attribute csv_file.



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

def csv_file
  @csv_file
end

#projectObject (readonly)

Returns the value of attribute project.



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

def project
  @project
end

Instance Method Details

#callObject



23
24
25
26
27
28
# File 'lib/ehpt/create_stories.rb', line 23

def call
  validate_csv_file!
  create_stories unless error?
rescue StandardError => e
  errors << e.message
end