Class: Dry::Validation::Rust::Contract::OptionDefinition Private

Inherits:
Data
  • Object
show all
Defined in:
lib/dry/validation/rust/contract.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, default: Contract::Undefined, optional: false) ⇒ OptionDefinition

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OptionDefinition.



22
23
24
# File 'lib/dry/validation/rust/contract.rb', line 22

def initialize(name:, default: Contract::Undefined, optional: false)
  super
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



21
22
23
# File 'lib/dry/validation/rust/contract.rb', line 21

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



21
22
23
# File 'lib/dry/validation/rust/contract.rb', line 21

def name
  @name
end

#optionalObject (readonly)

Returns the value of attribute optional

Returns:

  • (Object)

    the current value of optional



21
22
23
# File 'lib/dry/validation/rust/contract.rb', line 21

def optional
  @optional
end