Class: OrientDB::PropertyImpl

Inherits:
Object
  • Object
show all
Defined in:
lib/orientdb/property.rb

Instance Method Summary collapse

Instance Method Details

#infoObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/orientdb/property.rb', line 12

def info
  {
    :name         => name,
    :type         => type_short,
    :index        => indexed? ? getIndex.name : nil,
    :min          => min,
    :max          => max,
    :mandatory    => is_mandatory?,
    :not_null     => is_not_null?,
    :linked_type  => linked_type_short,
    :linked_class => linked_type_short ? getLinkedClass.name : nil,
  }
end

#inspectObject Also known as: to_s



26
27
28
29
30
31
32
# File 'lib/orientdb/property.rb', line 26

def inspect
  "#<OrientDB::Property:#{name} type=#{type_short} " +
    "#{linked_type_short ? "linked_type=#{linked_type_short} linked_class=#{getLinkedClass.name}" : ''}" +
    "indexed=#{is_indexed?} mandatory=#{is_mandatory?} not_null=#{is_not_null}" +
    "#{min ? " min=#{min}" : ''}#{max ? " max=#{max}" : ''}" +
    ">"
end

#linked_type_shortObject



8
9
10
# File 'lib/orientdb/property.rb', line 8

def linked_type_short
  @linked_type_short ||= getLinkedType && OrientDB::FIELD_TYPES.select { |k, v| v.name == getLinkedType.name }.first.first
end

#type_shortObject



4
5
6
# File 'lib/orientdb/property.rb', line 4

def type_short
  @type_short ||= OrientDB::FIELD_TYPES.select { |k, v| v.name == getType.name }.first.first
end