class PRlist::PullRequest
Attributes
issue[R]
Public Class Methods
new(issue)
click to toggle source
# File lib/pr_list/pull_requests.rb, line 15 def initialize(issue) @issue ||= issue end
Public Instance Methods
date()
click to toggle source
# File lib/pr_list/pull_requests.rb, line 19 def date @issue.created_at end
has_label?(filter_by)
click to toggle source
# File lib/pr_list/pull_requests.rb, line 23 def has_label?(filter_by) labels.any? { |label| [filter_by].flatten.map { |l| l.downcase.strip }.include?(label.downcase.strip) } end
labels()
click to toggle source
# File lib/pr_list/pull_requests.rb, line 27 def labels @issue.labels.map { |l| l.name } end
method_missing(method_sym, *arguments, &block)
click to toggle source
Calls superclass method
# File lib/pr_list/pull_requests.rb, line 7 def method_missing(method_sym, *arguments, &block) @issue.respond_to?(method_sym) ? @issue.send(method_sym, *arguments, &block) : super end
repo(opt = {})
click to toggle source
# File lib/pr_list/pull_requests.rb, line 31 def repo(opt = {}) opt[:short] = false unless opt.has_key?(:short) /repos\/(\w*\/?(.*))$/.match(@issue.repository_url)[opt[:short] ? 2 : 1] end
respond_to_missing?(method_name, include_private = false)
click to toggle source
Calls superclass method
# File lib/pr_list/pull_requests.rb, line 11 def respond_to_missing?(method_name, include_private = false) @issue.respond_to?(method_name.to_sym) || super end