Class: CapsuleCRM::Base
- Inherits:
-
Object
- Object
- CapsuleCRM::Base
- Includes:
- ActiveModel::Dirty, HTTParty
- Defined in:
- lib/capsulecrm/base.rb
Direct Known Subclasses
Constant Summary collapse
- @@last_response =
nil
Instance Attribute Summary collapse
-
#id ⇒ Object
nodoc.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Class Method Summary collapse
-
.find(what, options = {}) ⇒ Object
nodoc.
-
.last_response ⇒ Object
for debugging.
Instance Method Summary collapse
-
#==(other) ⇒ Object
nodoc.
-
#errors ⇒ Object
nodoc.
-
#initialize(attributes = {}) ⇒ Base
constructor
nodoc.
-
#new_record? ⇒ Boolean
nodoc.
Constructor Details
#initialize(attributes = {}) ⇒ Base
nodoc
27 28 29 30 31 32 |
# File 'lib/capsulecrm/base.rb', line 27 def initialize(attributes={}) attributes.each do |name, value| send("#{name}=", value) end changed_attributes.clear end |
Instance Attribute Details
#id ⇒ Object
nodoc
16 17 18 |
# File 'lib/capsulecrm/base.rb', line 16 def id @id end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
17 18 19 |
# File 'lib/capsulecrm/base.rb', line 17 def raw_data @raw_data end |
Class Method Details
.find(what, options = {}) ⇒ Object
nodoc
65 66 67 68 |
# File 'lib/capsulecrm/base.rb', line 65 def self.find(what, ={}) return find_all() if what == :all find_one(what) end |
.last_response ⇒ Object
for debugging
72 73 74 |
# File 'lib/capsulecrm/base.rb', line 72 def self.last_response @@last_response end |
Instance Method Details
#==(other) ⇒ Object
nodoc
36 37 38 39 |
# File 'lib/capsulecrm/base.rb', line 36 def ==(other) return false if other.nil? id == other.id end |
#errors ⇒ Object
nodoc
50 51 52 |
# File 'lib/capsulecrm/base.rb', line 50 def errors @errors ||= [] end |
#new_record? ⇒ Boolean
nodoc
56 57 58 |
# File 'lib/capsulecrm/base.rb', line 56 def new_record? id.nil? end |