Class: Pacer::Orient::Property
- Inherits:
-
Object
- Object
- Pacer::Orient::Property
- Extended by:
- Forwardable
- Defined in:
- lib/pacer-orient/property.rb
Instance Attribute Summary collapse
-
#el_type ⇒ Object
readonly
Returns the value of attribute el_type.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
- #create_index!(index_type = :not_unique) ⇒ Object
- #drop! ⇒ Object
- #drop_index! ⇒ Object
- #graph ⇒ Object
- #index_type ⇒ Object
-
#initialize(el_type, property) ⇒ Property
constructor
A new instance of Property.
- #inspect ⇒ Object
- #range_index? ⇒ Boolean
- #set_type!(t) ⇒ Object
- #unique_index? ⇒ Boolean
Constructor Details
#initialize(el_type, property) ⇒ Property
Returns a new instance of Property.
12 13 14 15 |
# File 'lib/pacer-orient/property.rb', line 12 def initialize(el_type, property) @el_type = el_type @property = property end |
Instance Attribute Details
#el_type ⇒ Object (readonly)
Returns the value of attribute el_type.
5 6 7 |
# File 'lib/pacer-orient/property.rb', line 5 def el_type @el_type end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
5 6 7 |
# File 'lib/pacer-orient/property.rb', line 5 def property @property end |
Instance Method Details
#create_index!(index_type = :not_unique) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/pacer-orient/property.rb', line 21 def create_index!(index_type = :not_unique) unless indexed? property.createIndex graph.index_type(index_type) end self end |
#drop! ⇒ Object
38 39 40 41 |
# File 'lib/pacer-orient/property.rb', line 38 def drop! el_type.drop_property! name nil end |
#drop_index! ⇒ Object
28 29 30 31 |
# File 'lib/pacer-orient/property.rb', line 28 def drop_index! graph.drop_key_index name if indexed? self end |
#graph ⇒ Object
17 18 19 |
# File 'lib/pacer-orient/property.rb', line 17 def graph el_type.graph end |
#index_type ⇒ Object
57 58 59 60 61 62 |
# File 'lib/pacer-orient/property.rb', line 57 def index_type if i = index t = Graph::ITYPE_REVERSE[i.getType] t[:type] if t end end |
#inspect ⇒ Object
74 75 76 |
# File 'lib/pacer-orient/property.rb', line 74 def inspect "#<#{ el_type.type_name.capitalize }Property #{ el_type.name }.#{ property.name } (#{ type })>" end |
#range_index? ⇒ Boolean
43 44 45 46 47 48 |
# File 'lib/pacer-orient/property.rb', line 43 def range_index? if i = index t = Graph::ITYPE_REVERSE[i.getType] t[:range] if t end end |
#set_type!(t) ⇒ Object
33 34 35 36 |
# File 'lib/pacer-orient/property.rb', line 33 def set_type!(t) # Not implemented as of 1.7.8 fail Pacer::InternalError.new("Type migration is a planned Orient 2.x feature") end |
#unique_index? ⇒ Boolean
50 51 52 53 54 55 |
# File 'lib/pacer-orient/property.rb', line 50 def unique_index? if i = index t = Graph::ITYPE_REVERSE[i.getType] t[:unique] if t end end |