Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Strict mode #28

Open
JelF opened this issue Feb 25, 2020 · 0 comments
Open

Strict mode #28

JelF opened this issue Feb 25, 2020 · 0 comments

Comments

@JelF
Copy link

JelF commented Feb 25, 2020

I.e.

class Foo
  include Tainbox
  self.strict_constructor = true
 
  attribute :foo, default: :bar
end

Foo.new(foo: 123).foo # => 123
Foo.new.foo # => :bar
Foo.new(bar: 123) # => raise ArgumentError
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant