Sha256: 081dd974f890403eb6182f5a8007090b2b88d62f4574b6e8a188f7782ecd3ac4

Contents?: true

Size: 514 Bytes

Versions: 39

Compression:

Stored size: 514 Bytes

Contents

require 'main'

# block-defaults are instance_eval'd in the main instance and be combined with
# mixins
#
# ./h.rb   #=> forty-two
# ./h.rb a #=> 42 
# ./h.rb b #=> 42.0 
#

Main {
  fattr :default_for_foobar => 'forty-two' 

  option(:foobar) do
    default{ default_for_foobar }
  end

  mixin :foo do
    fattr :default_for_foobar => 42
  end

  mixin :bar do
    fattr :default_for_foobar => 42.0
  end


  run{ p params[:foobar].value }

  mode :a do
    mixin :foo
  end

  mode :b do
    mixin :bar
  end
}

Version data entries

39 entries across 38 versions & 3 rubygems

Version Path
main-4.7.6 samples/h.rb
main-4.7.5 samples/h.rb
main-4.7.4 samples/h.rb
main-4.7.3 samples/h.rb
main-4.7.2 samples/h.rb
main-4.7.1 samples/h.rb
main-4.7.0 samples/h.rb
main-4.6.0 samples/h.rb
main-4.4.0 samples/h.rb
main-4.3.0 samples/h.rb
main-4.2.0 samples/h.rb
main-4.0.0 samples/h.rb
main-3.0.3 samples/h.rb
main-3.0.2 samples/h.rb
main-3.0.1 samples/h.rb
main-2.9.3 samples/h.rb
main-2.9.2 samples/h.rb
main-2.9.0 samples/h.rb
main-2.8.4 samples/h.rb