Class: ActiveRecord::ConnectionAdapters::Elasticsearch::Type::MulticastValue

Inherits:
Type::Value
  • Object
show all
Defined in:
lib/active_record/connection_adapters/elasticsearch/type/multicast_value.rb

Direct Known Subclasses

Range

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nested_type: nil) ⇒ MulticastValue

Returns a new instance of MulticastValue.



11
12
13
# File 'lib/active_record/connection_adapters/elasticsearch/type/multicast_value.rb', line 11

def initialize(nested_type: nil, **)
  @nested_type = nested_type || ActiveRecord::Type::Value.new
end

Instance Attribute Details

#nested_typeObject (readonly)

Returns the value of attribute nested_type.



9
10
11
# File 'lib/active_record/connection_adapters/elasticsearch/type/multicast_value.rb', line 9

def nested_type
  @nested_type
end

Instance Method Details

#deserialize(value) ⇒ Object?

overwrites the default deserialize behaviour

Parameters:

Returns:

  • (Object, nil)

    deserialized object



22
23
24
# File 'lib/active_record/connection_adapters/elasticsearch/type/multicast_value.rb', line 22

def deserialize(value)
  cast(_deserialize(value))
end

#typeObject



15
16
17
# File 'lib/active_record/connection_adapters/elasticsearch/type/multicast_value.rb', line 15

def type
  nested_type.type
end