Class: Virtus::TypeDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/virtus/attribute/builder.rb

Overview

Extracts the actual type primitive from input type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ TypeDefinition

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 TypeDefinition.



43
44
45
46
# File 'lib/virtus/attribute/builder.rb', line 43

def initialize(type)
  @type = type
  initialize_primitive
end

Instance Attribute Details

#primitiveObject (readonly)



40
41
42
# File 'lib/virtus/attribute/builder.rb', line 40

def primitive
  @primitive
end

#typeObject (readonly)



40
41
42
# File 'lib/virtus/attribute/builder.rb', line 40

def type
  @type
end

Instance Method Details

#pending?Boolean

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:

  • (Boolean)


49
50
51
# File 'lib/virtus/attribute/builder.rb', line 49

def pending?
  @pending if defined?(@pending)
end