Skip to content

To much magic... ({} != Hash.new()) #39

@Edgy

Description

@Edgy

First off - thank you very much for creating boson. I've found it to be a wonderful tool. Recently I've been upgrading from < 1.0 to 1.2.3. I've noticed that defining "options" as "Hash.new()" does not work.

module Foo
  option :urgent, type: :boolean, default: true
  def say(text, options=Hash.new())
    text.capitalize! if options[:urgent]
    puts text
  end
end

Where as this works:

module Foo
  option :urgent, type: :boolean, default: true
  def say(text, options={})
    text.capitalize! if options[:urgent]
    puts text
  end
end

This was execute with: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions