Sha256: b647fcbe85ab42565bb1b27c7c3b2dd42b07ebd99f8c01dbdbccac7c936c5a7d

Contents?: true

Size: 294 Bytes

Versions: 5

Compression:

Stored size: 294 Bytes

Contents

module Rail
  class Context
    def initialize(options = {})
      (options[:mixins] || []).each { |mixin| extend(mixin) }
      singleton_class.class_eval do
        (options[:locals] || {}).each do |name, value|
          define_method(name) { value }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rail-0.1.1 lib/rail/context.rb
rail-0.1.0 lib/rail/context.rb
rail-0.0.8 lib/rail/context.rb
rail-0.0.7 lib/rail/context.rb
rail-0.0.6 lib/rail/context.rb