Class: GhDraftIssueConverter::DraftIssue

Inherits:
Object
  • Object
show all
Defined in:
lib/gh_draft_issues_converter/gh_draft_issues_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, title, body, assign_user_ids, field_values) ⇒ DraftIssue

[

FieldValue, FieldValue

]

Parameters:

  • assign_user_ids (Array<String>)


14
15
16
17
18
19
20
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 14

def initialize(id, title, body, assign_user_ids, field_values)
  @id = id
  @title = title
  @body = body
  @field_values = field_values
  @assign_user_ids = assign_user_ids
end

Instance Attribute Details

#assign_user_idsObject (readonly)

Returns the value of attribute assign_user_ids.



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

def assign_user_ids
  @assign_user_ids
end

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#field_valuesObject (readonly)

Returns the value of attribute field_values.



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

def field_values
  @field_values
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#unnecessary_for_convert_issue?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 22

def unnecessary_for_convert_issue?
  false

  #field_values.any? do |field_value|
  #  field_value.field_name == "Status" && field_value.field_value_name == "🚫unnecessary"
  #end
end

#user_ids_github_formatObject



30
31
32
# File 'lib/gh_draft_issues_converter/gh_draft_issues_converter.rb', line 30

def user_ids_github_format
  assign_user_ids.map { |id| "\"#{id}\""}.join(", ")
end