class Fakecrm::Event

Public Class Methods

virtual_properties() click to toggle source
# File lib/fakecrm/resource/event.rb, line 28
def virtual_properties
  [:custom_attributes]
end

Public Instance Methods

attributes=(attributes) click to toggle source
Calls superclass method
# File lib/fakecrm/resource/event.rb, line 45
def attributes=(attributes)
  custom_attributes = attributes.delete("custom_attributes") || attributes.delete(:custom_attributes) || []
  super(attributes) && (custom_attributes.empty? || (self.custom_attributes = custom_attributes))
end
custom_attributes() click to toggle source
# File lib/fakecrm/resource/event.rb, line 37
def custom_attributes
  custom_type ? custom_type.custom_attributes : []
end
custom_attributes=(new_attributes) click to toggle source
# File lib/fakecrm/resource/event.rb, line 41
def custom_attributes=(new_attributes)
  custom_type.update({"custom_attributes"=>new_attributes})
end
custom_type() click to toggle source
# File lib/fakecrm/resource/event.rb, line 33
def custom_type
  CustomType.first_or_create(:kind => 'EventContact', :name => self.kind)
end