Class: NoSE::Serialize::EntityFieldRepresenter

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::Hash, Representable::JSON, Representable::Uncached, Representable::YAML
Defined in:
lib/nose/serialize.rb

Overview

Represents all data of a field

Instance Method Summary collapse

Methods included from Representable::Uncached

#representable_map

Instance Method Details

#entityString

The entity name for foreign keys

Returns:

  • (String)


161
162
163
164
# File 'lib/nose/serialize.rb', line 161

def entity
  represented.entity.name \
    if represented.is_a? Fields::ForeignKeyField
end

#relationshipSymbol

The cardinality of the relationship

Returns:

  • (Symbol)


169
170
171
172
# File 'lib/nose/serialize.rb', line 169

def relationship
  represented.relationship \
    if represented.is_a? Fields::ForeignKeyField
end

#reverseString

The reverse

Returns:

  • (String)


177
178
179
180
# File 'lib/nose/serialize.rb', line 177

def reverse
  represented.reverse.name \
    if represented.is_a? Fields::ForeignKeyField
end