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-6.3.0 samples/h.rb
main-6.2.3 samples/h.rb
main-6.2.2 samples/h.rb
main-6.2.1 samples/h.rb
main-6.2.0 samples/h.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/h.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/h.rb
main-6.1.0 samples/h.rb
ahoward-main-2.9.0 samples/h.rb
main-6.0.0 samples/h.rb
main-5.3.2 samples/h.rb
main-5.3.1 samples/h.rb
main-5.2.0 samples/h.rb
main-5.1.1 samples/h.rb
main-5.1.0 samples/h.rb
main-5.0.1 samples/h.rb
main-5.0.0 samples/h.rb
main-4.8.1 samples/h.rb
main-4.8.0 samples/h.rb
main-4.7.7 samples/h.rb