Class: Jirify::Models::ProjectList

Inherits:
BaseList show all
Defined in:
lib/jirify/models/project_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) ⇒ ProjectList

Returns a new instance of ProjectList.



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

def initialize(list)
  @list = list.map { |project| Project.new project }
end

Dynamic Method Handling

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

Class Method Details

.allObject



21
22
23
# File 'lib/jirify/models/project_list.rb', line 21

def all
  ProjectList.new client.Project.all
end

Instance Method Details

#find_by_name(name) ⇒ Object



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

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

#keysObject



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

def keys
  map(&:key)
end

#namesObject



16
17
18
# File 'lib/jirify/models/project_list.rb', line 16

def names
  map(&:name)
end