tainbox icon indicating copy to clipboard operation
tainbox copied to clipboard

Attribute injection for Ruby objects

Results 11 tainbox issues
Sort by recently updated
recently updated
newest added

I.e. ```ruby 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 ```

From documentation about [Kernel#Integer](https://ruby-doc.org/core-2.6.3/Kernel.html#method-i-Integer): ``` If arg is a String, when base is omitted or equals zero, radix indicators (0, 0b, and 0x) are honored. ``` So, usually, when a...

```Ruby class User attribute :admin?, default: false end person = User.new person.admin? # => false person.admin # => false person.admin! # => # person.admin? # => true person.admin # =>...

`#attribute_provided?` should return `false` for attributes with default values. ```Ruby class Foo include Tainbox attribute :bar, Integer attribute :baz, Integer, default: 0 end foo = Foo.new expect(foo.bar).to eq(nil) expect(foo.attribute_provided?(:bar)).to be_falsey...

For example: ``` class Person include Tainbox attribute :name, default: 'Vasya', writer: false end Person.new.name # => nil ``` It is expected to be 'Vasya'.

Scenario: 1) i need to supress initializer 2) i need to set default values