Sha256: 3f8203960d9eb7775fd30af1bed3bc193fb7a6d628269285c162688ba398b228

Contents?: true

Size: 315 Bytes

Versions: 9

Compression:

Stored size: 315 Bytes

Contents

require 'mustache'

class MethodMissing < Mustache
  self.template = '[ {{#list}}{{.}} {{/list}}]'

  def method_missing(name, *args, &block)
    return (0..10).to_a if name == :list
    return super
  end

  def respond_to?(method)
    method == :list
  end
end

if $0 == __FILE__
  puts MethodMissing.to_html
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
zine_brewer-1.5.0 vendor/bundle/ruby/2.7.0/gems/mustache-1.1.1/test/fixtures/method_missing.rb
zine_brewer-1.3.0 vendor/bundle/ruby/2.7.0/gems/mustache-1.1.1/test/fixtures/method_missing.rb
mustache-1.1.1 test/fixtures/method_missing.rb
mustache-1.1.0 test/fixtures/method_missing.rb
mustache-1.0.5 test/fixtures/method_missing.rb
mustache-1.0.3 test/fixtures/method_missing.rb
mustache-1.0.2 test/fixtures/method_missing.rb
mustache-1.0.1 test/fixtures/method_missing.rb
mustache-1.0.0 test/fixtures/method_missing.rb