Class: Neography::PropertyContainer

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/neography/property_container.rb

Direct Known Subclasses

Node, Relationship

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = nil) ⇒ PropertyContainer

Returns a new instance of PropertyContainer.



5
6
7
8
9
10
11
12
13
14
# File 'lib/neography/property_container.rb', line 5

def initialize(hash=nil)
  @table = {}
  if hash
    @neo_id = hash["self"].split('/').last
    for k,v in hash["data"]
      @table[k.to_sym] = v
      new_ostruct_member(k)
    end
  end
end

Instance Attribute Details

#neo_idObject (readonly)

Returns the value of attribute neo_id.



3
4
5
# File 'lib/neography/property_container.rb', line 3

def neo_id
  @neo_id
end