Module: Sinatra::AssetPack::Configurator::ClassMethods

Defined in:
lib/sinatra/assetpack/configurator.rb

Instance Method Summary collapse

Instance Method Details

#attrib(name) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/sinatra/assetpack/configurator.rb', line 9

def attrib(name)
  define_method(:"#{name}") { |*a|
    value = a.first
    self.instance_variable_set :"@#{name}", value  unless value.nil?
    self.instance_variable_get :"@#{name}"
  }

  alias_method(:"#{name}=", :"#{name}")
end