Module: Pakyow::Support::DeepFreeze

Included in:
Configurable::Config, Configurable::Setting
Defined in:
lib/pakyow/support/deep_freeze.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(subclass) ⇒ Object



8
9
10
11
12
# File 'lib/pakyow/support/deep_freeze.rb', line 8

def self.extended(subclass)
  subclass.instance_variable_set(:@unfreezable_variables, [])

  super
end

Instance Method Details

#inherited(subclass) ⇒ Object



14
15
16
17
18
# File 'lib/pakyow/support/deep_freeze.rb', line 14

def inherited(subclass)
  subclass.instance_variable_set(:@unfreezable_variables, @unfreezable_variables)

  super
end

#unfreezable(*ivars) ⇒ Object



20
21
22
23
# File 'lib/pakyow/support/deep_freeze.rb', line 20

def unfreezable(*ivars)
  @unfreezable_variables.concat(ivars.map { |ivar| :"@#{ivar}" })
  @unfreezable_variables.uniq!
end