Module: Neo4j::Wrapper::Property::InstanceMethods
- Included in:
- NodeMixin, RelationshipMixin
- Defined in:
- lib/neo4j-wrapper/properties/instance_methods.rb
Instance Method Summary collapse
-
#attributes ⇒ Hash
Return a hash of ‘public’ properties.
Instance Method Details
#attributes ⇒ Hash
Return a hash of ‘public’ properties. If there is an accessor method available it will use that. That means you can override the returned value of the property by implementing a method of the same name as the property. All properteis not starting with _
are considered public.
10 11 12 13 14 15 |
# File 'lib/neo4j-wrapper/properties/instance_methods.rb', line 10 def attributes attr = props ret = {} attr.each_pair { |k, v| ret[k] = respond_to?(k) ? send(k) : v unless k.to_s[0] == ?_ } ret end |