Module: CurrencyCloud::Resource

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#changed_attributesObject (readonly)

Returns the value of attribute changed_attributes.



11
12
13
# File 'lib/currency_cloud/resource.rb', line 11

def changed_attributes
  @changed_attributes
end

Class Method Details

.included(base) ⇒ Object



7
8
9
# File 'lib/currency_cloud/resource.rb', line 7

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#initialize(attributes) ⇒ Object



13
14
15
16
17
# File 'lib/currency_cloud/resource.rb', line 13

def initialize(attributes)
  @attributes = attributes
  @changed_attributes = Set.new
  self.accessors = valid_attributes
end

#inspectObject



19
20
21
# File 'lib/currency_cloud/resource.rb', line 19

def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)} #{@attributes.inspect}>"
end