Object
Builder is used to set up an attribute instance based on input type and options
@private
@api private
# File lib/virtus/attribute/builder.rb, line 90 def self.call(type, options = {}) type_definition = TypeDefinition.new(type) if type_definition.pending? PendingAttribute.new(type, options) else new(type_definition, options).attribute end end
@api private
# File lib/virtus/attribute/builder.rb, line 101 def self.determine_type(klass, default = nil) type = Attribute.determine_type(klass) if klass.is_a?(Class) type ||= if klass < Axiom::Types::Type determine_type(klass.primitive) elsif EmbeddedValue.handles?(klass) EmbeddedValue elsif klass < Enumerable && !(klass <= Range) Collection end end type || default end
@api private
# File lib/virtus/attribute/builder.rb, line 119 def initialize(type_definition, options) @type_definition = type_definition initialize_class initialize_type initialize_options(options) initialize_default_value initialize_coercer initialize_attribute end
Generated with the Darkfish Rdoc Generator 2.