Class: Hanami::Entity::Schema::Schemaless Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/entity/schema.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Schemaless entities logic

Since:

  • 0.7.0

Instance Method Summary collapse

Constructor Details

#initializeSchemaless

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Schemaless.

Since:

  • 0.7.0



64
65
66
# File 'lib/hanami/entity/schema.rb', line 64

def initialize
  freeze
end

Instance Method Details

#attribute?(_name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.7.0



84
85
86
# File 'lib/hanami/entity/schema.rb', line 84

def attribute?(_name)
  true
end

#call(attributes) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • attributes (#to_hash)

    the attributes hash

Returns:

  • (Hash)

Since:

  • 0.7.0



74
75
76
77
78
79
80
# File 'lib/hanami/entity/schema.rb', line 74

def call(attributes)
  if attributes.nil?
    {}
  else
    Utils::Hash.deep_symbolize(attributes.to_hash.dup)
  end
end