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

Inherits:
Virtus::Attribute::Collection
  • Object
show all
Defined in:
lib/json/schematized/virtus_0_5_x_wrapper.rb,
lib/json/schematized/virtus_1_x_x_wrapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.merge_options(type, options) ⇒ Object



79
80
81
82
83
# File 'lib/json/schematized/virtus_0_5_x_wrapper.rb', line 79

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



75
76
77
# File 'lib/json/schematized/virtus_0_5_x_wrapper.rb', line 75

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