Sha256: 6b5436c43b1ccc735e872aee32f0b12f83b344d0ba64099ee2535d88956c62f8

Contents?: true

Size: 485 Bytes

Versions: 30

Compression:

Stored size: 485 Bytes

Contents

module Sinatra
  module AssetPack
    module Configurator
      def self.included(klass)
        klass.extend ClassMethods
      end

      module ClassMethods
        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
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
sinatra-assetpack-0.3.5 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.3.3 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.3.2 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.3.1 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.3.0 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.8 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.7 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.6 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.5 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.4 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.3 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.2 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.1 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.2.0 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.1.7 lib/sinatra/assetpack/configurator.rb
sundawg-sinatra-assetpack-fork-0.1.6 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.1.6 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.1.5 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.1.4 lib/sinatra/assetpack/configurator.rb
sinatra-assetpack-0.1.3 lib/sinatra/assetpack/configurator.rb