Class: Clearbooks::Project

Inherits:
Base
  • Object
show all
Defined in:
lib/clearbooks/model/project.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

build, create

Constructor Details

#initialize(data) ⇒ Project

Returns a new instance of Project.

Parameters:



32
33
34
35
36
37
# File 'lib/clearbooks/model/project.rb', line 32

def initialize data
  @id           = data.savon(:id).to_i
  @description  = data.savon :description
  @project_name = data.savon :project_name
  @status       = data.savon :status
end

Instance Attribute Details

#descriptionObject (readonly)

Required. The description of the project.



16
17
18
# File 'lib/clearbooks/model/project.rb', line 16

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



14
15
16
# File 'lib/clearbooks/model/project.rb', line 14

def id
  @id
end

#project_nameObject (readonly)

Optional. The name of the project.



20
21
22
# File 'lib/clearbooks/model/project.rb', line 20

def project_name
  @project_name
end

#statusObject (readonly)

Optional. String identifying the project status. Use one of the following values: “open”, “closed” or “deleted”.



24
25
26
# File 'lib/clearbooks/model/project.rb', line 24

def status
  @status
end

Instance Method Details

#to_savonHash

Returns self as Savon readable Hash

Returns:

  • (Hash)

    Returns self as Savon readable Hash



43
44
45
46
47
48
49
50
51
# File 'lib/clearbooks/model/project.rb', line 43

def to_savon
  {
    project: {
      :@projectName => @project_name,
      :@status => @status,
      :@description => @description
    }
  }
end