Sha256: 1e5da0254d9b774ebaf8d6f9bc4a4a9fda49f053d060f8c65164440a5b439d06

Contents?: true

Size: 418 Bytes

Versions: 9

Compression:

Stored size: 418 Bytes

Contents

require 'mustache'

module SimpleView
  def name
    "Bob"
  end

  def value
    100_000
  end

  def taxed_value
    value - (value * 0.4)
  end

  def in_ca
    false
  end
end

class PartialWithModule < Mustache
  include SimpleView
  self.path = File.dirname(__FILE__)

  def greeting
    "Welcome"
  end

  def farewell
    "Fair enough, right?"
  end
end

if $0 == __FILE__
  puts PartialWithModule.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/partial_with_module.rb
zine_brewer-1.3.0 vendor/bundle/ruby/2.7.0/gems/mustache-1.1.1/test/fixtures/partial_with_module.rb
mustache-1.1.1 test/fixtures/partial_with_module.rb
mustache-1.1.0 test/fixtures/partial_with_module.rb
mustache-1.0.5 test/fixtures/partial_with_module.rb
mustache-1.0.3 test/fixtures/partial_with_module.rb
mustache-1.0.2 test/fixtures/partial_with_module.rb
mustache-1.0.1 test/fixtures/partial_with_module.rb
mustache-1.0.0 test/fixtures/partial_with_module.rb