BaseRecord
# File lib/tarantool/light_record.rb, line 76 def create(attrs) new(attrs).save end
# File lib/tarantool/light_record.rb, line 64 def define_field_accessor(name, type) generated_attribute_methods.class_eval def #{name} @attributes[:"#{name}"] end def #{name}=(v) @attributes[:"#{name}"] = v end, __FILE__, __LINE__ - 1 end
# File lib/tarantool/light_record.rb, line 80 def from_fetched(attributes) attributes && allocate.__fetched(attributes) end
# File lib/tarantool/light_record.rb, line 12 def __fetched(attributes) @__new_record = false @attributes = attributes after_init self end
# File lib/tarantool/light_record.rb, line 50 def after_create; end
# File lib/tarantool/light_record.rb, line 54 def after_destroy; end
callback which runs both after initialization and after fetching from database
# File lib/tarantool/light_record.rb, line 21 def after_init end
# File lib/tarantool/light_record.rb, line 52 def after_save; end
# File lib/tarantool/light_record.rb, line 51 def after_update; end
# File lib/tarantool/light_record.rb, line 48 def before_create; true end
# File lib/tarantool/light_record.rb, line 53 def before_destroy; true end
# File lib/tarantool/light_record.rb, line 47 def before_save; true end
# File lib/tarantool/light_record.rb, line 49 def before_update; true end
# File lib/tarantool/light_record.rb, line 40 def destroy return false unless before_destroy self.class.delete id after_destroy true end
# File lib/tarantool/light_record.rb, line 24 def save return false unless before_save if @__new_record return false unless before_create self.class.insert(@attributes) @__new_record = false after_create else return false unless before_update self.class.replace(@attributes) after_update end after_save self end
Generated with the Darkfish Rdoc Generator 2.