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 followers comments reviews
]
INT_ARRAY_TYPE_ATTRIBUTES =
%w[
  owner_ids label_ids task_ids pull_request_ids branch_ids
  blocker_ids follower_ids comment_ids review_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_content, project) ⇒ CreateStories

Returns a new instance of CreateStories.



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

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

Instance Attribute Details

#csv_contentObject (readonly)

Returns the value of attribute csv_content.



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

def csv_content
  @csv_content
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



28
29
30
31
32
33
34
# File 'lib/ehpt/create_stories.rb', line 28

def call
  validate_csv_content!
  create_stories unless error?
  puts "Done"
rescue StandardError => e
  errors << e.message
end