Class: Project

Inherits:
Domain::Model show all
Defined in:
lib/domain/project/model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::Model

columns, from_csv, from_json, headers, primary_key, table_name, #to_csv, #to_hash, #to_s, view

Constructor Details

#initialize(attributes = {}) ⇒ Project

Returns a new instance of Project.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/domain/project/model.rb', line 8

def initialize(attributes = {})
  remapped_attributes = attributes.transform_keys do |key|
    case key
    when 'project_id' then 'id'
    when 'project_name' then 'name'
    when 'project_description' then 'description'
    when 'project_org' then 'org'
    when 'project_groups' then 'groups'
    else key # For all other keys that do not need remapping
    end
  end
  super(remapped_attributes) # Call the superclass's initialize method
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def description
  @description
end

#groupsObject

Returns the value of attribute groups.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def groups
  @groups
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def name
  @name
end

#orgObject

Returns the value of attribute org.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def org
  @org
end

#tracking_methodObject

Returns the value of attribute tracking_method.



6
7
8
# File 'lib/domain/project/model.rb', line 6

def tracking_method
  @tracking_method
end

Class Method Details

.url_pathObject



22
23
24
# File 'lib/domain/project/model.rb', line 22

def self.url_path
  '/projects'
end