Class: EntitySchema::Fields::Property

Inherits:
Abstract
  • Object
show all
Defined in:
lib/entity_schema/fields/property.rb

Overview

Simple field with any value

Direct Known Subclasses

FkBelongsTo

Instance Attribute Summary

Attributes inherited from Abstract

#name, #specification, #src_key

Instance Method Summary collapse

Methods inherited from Abstract

#given?, #public_get, #public_set, #serialize, #set

Constructor Details

#initialize(options) ⇒ Property

Returns a new instance of Property.



11
12
13
14
# File 'lib/entity_schema/fields/property.rb', line 11

def initialize(options)
  super(options)
  specification.predicate = options[:predicate]
end

Instance Method Details

#get(obj) ⇒ Object



16
17
18
# File 'lib/entity_schema/fields/property.rb', line 16

def get(obj)
  read(obj)
end