Class: JSON::Schematized::VirtusWrapper::Attribute::Array

Inherits:
Virtus::Attribute::Array
  • Object
show all
Defined in:
lib/json/schematized/virtus_wrapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.merge_options(type, options) ⇒ Object



74
75
76
77
78
# File 'lib/json/schematized/virtus_wrapper.rb', line 74

def self.merge_options(type, options)
  merged_options = super
  klass = type.is_a?(Class) ? type : type.class
  merged_options.merge(:primitive => klass)
end

Instance Method Details

#new_collectionObject



70
71
72
# File 'lib/json/schematized/virtus_wrapper.rb', line 70

def new_collection
  (@primitive || self.class.primitive).new
end