Sha256: 2da70606a650bf6982dbd76927a41817716f0eeb264e28ac64034f8b4ba63682

Contents?: true

Size: 319 Bytes

Versions: 10

Compression:

Stored size: 319 Bytes

Contents

class SmallCage::ErbBase
  def initialize(loader, renderer, obj)
    @loader, @renderer, @obj = loader, renderer, obj
  end

  def method_missing(name)
    n = name.to_s
    
    return @obj[n] unless @obj[n].nil?

    # render if template file exists. or return nil.
    return @renderer.render(name, @obj)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
bluemark-smallcage-0.1.4 lib/smallcage/erb_base.rb
bluemark-smallcage-0.1.5 lib/smallcage/erb_base.rb
smallcage-0.2.1 lib/smallcage/erb_base.rb
smallcage-0.2.0 lib/smallcage/erb_base.rb
smallcage-0.1.9 lib/smallcage/erb_base.rb
smallcage-0.1.8 lib/smallcage/erb_base.rb
smallcage-0.1.7 lib/smallcage/erb_base.rb
smallcage-0.1.6 lib/smallcage/erb_base.rb
smallcage-0.1.5 lib/smallcage/erb_base.rb
smallcage-0.1.4 lib/smallcage/erb_base.rb