Class: TaskMapper::Provider::Trello::Project

Inherits:
Base::Project
  • Object
show all
Defined in:
lib/provider/project.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*object) ⇒ Project

Returns a new instance of Project.



4
5
6
7
8
9
# File 'lib/provider/project.rb', line 4

def initialize(*object)
  if object.first
    object = object.first
    super object
  end
end

Class Method Details

.find_allObject



16
17
18
19
# File 'lib/provider/project.rb', line 16

def find_all
  boards = TaskMapper::Provider::Trello.api.boards
  boards.map { |board| self.new board.attributes }
end

.find_by_attributes(attributes = {}) ⇒ Object



12
13
14
# File 'lib/provider/project.rb', line 12

def find_by_attributes(attributes = {})
  search_by_attribute(self.find_all, attributes)
end

.find_by_id(id) ⇒ Object



21
22
23
24
# File 'lib/provider/project.rb', line 21

def find_by_id(id)
  board = TaskMapper::Provider::Trello.api.boards.find { |f| f.id == id}
  self.new board.attributes
end