Class: Kanbanize::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/kanbanize/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api, attributes) ⇒ Project

Returns a new instance of Project.

Raises:

  • (ArgumentError)

5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kanbanize/project.rb', line 5

def initialize(api, attributes)
  raise ArgumentError unless attributes['id']
  raise ArgumentError unless attributes['name']

  @id = attributes['id'].to_i
  @name = attributes['name']

  @boards = []
  if attributes['boards']
    attributes['boards'].each do |board|
      @boards << Board.new(api, board)
    end
  end
end

Instance Attribute Details

#boardsObject (readonly)

Returns the value of attribute boards


3
4
5
# File 'lib/kanbanize/project.rb', line 3

def boards
  @boards
end

#idObject (readonly)

Returns the value of attribute id


3
4
5
# File 'lib/kanbanize/project.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name


3
4
5
# File 'lib/kanbanize/project.rb', line 3

def name
  @name
end