Class: Dry::ElasticModel::Base

Inherits:
Struct
  • Object
show all
Extended by:
Attributes, Schema
Defined in:
lib/dry/elastic_model/base.rb

Direct Known Subclasses

TypeOptions::IP

Constant Summary

Constants included from Types

Types::Array, Types::BYTE_LIMIT, Types::Binary, Types::Boolean, Types::Byte, Types::Date, Types::DateTime, Types::Double, Types::Float, Types::HalfFloat, Types::INTEGER_LIMIT, Types::IP, Types::Integer, Types::Keyword, Types::LONG_LIMIT, Types::Long, Types::MAX_UNIX_TIME, Types::ObjectType, Types::RANGE_KEYS, Types::RANGE_TYPES, Types::Range, Types::SHORT_LIMIT, Types::ScaledFloat, Types::Short, Types::TYPES, Types::Text

Instance Method Summary collapse

Methods included from Schema

mapping, parse_definition

Methods included from Attributes

field, list, range

Instance Method Details

#as_json(opts = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/dry/elastic_model/base.rb', line 11

def as_json(opts = {})
  if attributes.respond_to? :as_json
    attributes.as_json(opts)
  else
    attributes
  end
end