class StoreModel::Types::OneOf

Implements ActiveModel::Type::Value type for handling an array of StoreModel::Model

Public Class Methods

new(&block) click to toggle source
# File lib/store_model/types/one_of.rb, line 10
def initialize(&block)
  @block = block
end

Public Instance Methods

to_array_type() click to toggle source
# File lib/store_model/types/one_of.rb, line 18
def to_array_type
  Types::ManyPolymorphic.new(@block)
end
to_type() click to toggle source
# File lib/store_model/types/one_of.rb, line 14
def to_type
  Types::OnePolymorphic.new(@block)
end