Class: Jirify::Models::TransitionList

Inherits:
BaseList show all
Defined in:
lib/jirify/models/transition_list.rb

Instance Attribute Summary

Attributes inherited from BaseList

#list

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseList

#each

Methods inherited from Base

client, #method_missing, #respond_to_missing?

Constructor Details

#initialize(list) ⇒ TransitionList

Returns a new instance of TransitionList.



4
5
6
# File 'lib/jirify/models/transition_list.rb', line 4

def initialize(list)
  @list = list.map { |transition| Transition.new transition }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Jirify::Models::Base

Class Method Details

.all(issue) ⇒ Object



23
24
25
# File 'lib/jirify/models/transition_list.rb', line 23

def all(issue)
  TransitionList.new client.Transition.all(issue: issue)
end

Instance Method Details

#find_by_name(name) ⇒ Object



8
9
10
# File 'lib/jirify/models/transition_list.rb', line 8

def find_by_name(name)
  find { |transition| transition.name == name }
end

#namesObject



12
13
14
# File 'lib/jirify/models/transition_list.rb', line 12

def names
  map(&:name)
end