Class: ProsperWorks::Base

Inherits:
Object
  • Object
show all
Includes:
SerializeEntity
Defined in:
lib/prosperworks/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializeEntity

#to_json

Constructor Details

#initialize(attributes = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
# File 'lib/prosperworks/base.rb', line 12

def initialize(attributes = {})
  set_attributes(attributes)
end

Instance Attribute Details

#date_createdObject

Returns the value of attribute date_created.



5
6
7
# File 'lib/prosperworks/base.rb', line 5

def date_created
  @date_created
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/prosperworks/base.rb', line 5

def id
  @id
end

Class Method Details

.clientObject



8
9
10
# File 'lib/prosperworks/base.rb', line 8

def self.client
  ProsperWorks.client
end

Instance Method Details

#set_attributes(attributes) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/prosperworks/base.rb', line 16

def set_attributes(attributes)
  attributes.each do |key, value|
    if self.respond_to?(key.to_sym)
      self.send("#{key}=", value)
    end
  end
end