Sha256: 4cffbdd7f7bee4553580a7db00691ef33606711332009ce5dcf8dd6c023abf64
Contents?: true
Size: 809 Bytes
Versions: 5
Compression:
Stored size: 809 Bytes
Contents
module ActiveRecordSeek module Concerns module InstanceVariableConcern extend ActiveSupport::Concern def initialize(variables = {}) set(variables) after_initialize end def after_initialize # noop end def set(params = {}) params.each { |key, value| send("#{key}=", value) } self end def instance_variable_reset(variable, &block) if instance_variable_defined?(variable) remove_instance_variable(variable) true else false end end def instance_variable_yield(variable) if instance_variable_defined?(variable) value = instance_variable_get(variable) yield(value) value end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems