class DevTraining::Issue
Class representing a GitHub issue, lazily instantiated.
Attributes
The issue description – part of the body, optional, read from the data
An array of tasks – rendered as a task list as part of the body, optional, and read from the data
The issue title – read from, and required to be in the data
Public Class Methods
Source
# File lib/dev_training/issue.rb, line 29 def initialize(client, repo, milestone, data) @client = client @repo = repo @milestone = milestone @title = data.fetch('title') @description = data['description'] @subtasks = data['subtasks'] end
Arguments:
-
client: AnOctokit::Client -
repo: ADevTraining::Repository -
milestone: ADevTraining::Milestone -
data: AHashcontaining the keys,title,description(optional), andsubtasks(optional). Likely read in from a YAML file.
Public Instance Methods
Source
# File lib/dev_training/issue.rb, line 40 def body format_body(@description, @subtasks) end
The text of this issue’s body (uses DevTraining::FormattingHelpers.format_body)
Source
# File lib/dev_training/issue.rb, line 47 def resource @resource ||= find || create end
The Sawyer::Resource representing the GitHub issue. It will be found by title and milestone, or created in the repository if not found.