Class: Paymo::Project

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Project

Returns a new instance of Project.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/paymo/models/project.rb', line 7

def initialize(result)
  @id             = result['id'].to_i
  @retired        = !!result['retired']
  @name           = result['name']['_content']
  @description    = result['description']['_content']
  @budget_hours   = result['budget_hours']['_content'].to_f
  @price_per_hour = result['price_per_hour']['_content'].to_f
  @client_id      = result['client']['id'].to_i
  @client_name    = result['client']['name']
  @users          = result['users']
end

Instance Attribute Details

#budget_hoursObject

Returns the value of attribute budget_hours.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def budget_hours
  @budget_hours
end

#client_idObject

Returns the value of attribute client_id.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def client_id
  @client_id
end

#client_nameObject

Returns the value of attribute client_name.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def client_name
  @client_name
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def description
  @description
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def name
  @name
end

#price_per_hourObject

Returns the value of attribute price_per_hour.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def price_per_hour
  @price_per_hour
end

#retiredObject

Returns the value of attribute retired.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def retired
  @retired
end

#usersObject

Returns the value of attribute users.



4
5
6
# File 'lib/paymo/models/project.rb', line 4

def users
  @users
end