Sha256: 4fb3dabf6052f49c55add116fc87a71ed44dbc991312a61e437eae2b67e287c5

Contents?: true

Size: 330 Bytes

Versions: 2

Compression:

Stored size: 330 Bytes

Contents

require 'canpe/template_binding_reflector'

module Canpe
  class TemplateBindingContainer
    attr_reader :hash

    def initialize(hash)
      @hash = hash
    end

    def [](name)
      if hash.key? name
        hash[name]
      else
        TemplateBindingReflector.new([{method: name, args: []}])
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
canpe-0.1.1 lib/canpe/template_binding_container.rb
canpe-0.1.0 lib/canpe/template_binding_container.rb