Class: Interdependence::Types::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/interdependence/types.rb

Overview

Wrapper for validator fields

Useful for handling and resolving cases where fields are not yet specified

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Void

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.

Create a new field

Parameters:

  • name (Symbol)
    name of field


69
70
71
# File 'lib/interdependence/types.rb', line 69

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameSymbol (readonly)

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.

name of field

Returns:

  • (Symbol)


59
60
61
# File 'lib/interdependence/types.rb', line 59

def name
  @name
end

Instance Method Details

#==(other) ⇒ TrueClass, FalseClass Also known as: eql?

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.

Compare with other field

Parameters:

Returns:

  • (TrueClass, FalseClass)


91
92
93
# File 'lib/interdependence/types.rb', line 91

def ==(other)
  name.equal?(other.name)
end

#unset?FalseClass

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.

Always return false. For comparing with UnsetField

Returns:

  • (FalseClass)


79
80
81
# File 'lib/interdependence/types.rb', line 79

def unset?
  false
end