Class: OrientSupport::Hash
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- OrientSupport::Hash
show all
- Includes:
- Support
- Defined in:
- lib/orient.rb
Instance Method Summary
collapse
Methods included from Support
#compose_where, #generate_sql_list
Constructor Details
#initialize(modelinstance, args) ⇒ Hash
Returns a new instance of Hash.
111
112
113
114
115
116
117
118
119
120
|
# File 'lib/orient.rb', line 111
def initialize modelinstance, args
@orient = modelinstance
super args.from_orient
@name = modelinstance.attributes.key(self)
@name = yield if @name.nil? && block_given?
end
|
Instance Method Details
#[]=(key, value) ⇒ Object
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# File 'lib/orient.rb', line 123
def []= key, value
puts " i will handle this in the future"
super key, value
@orient.update set:{ @name => self}
end
|
#delete(key) ⇒ Object
137
138
139
140
|
# File 'lib/orient.rb', line 137
def delete key
super key
@orient.update set:{ @name => self}
end
|
#delete_if(&b) ⇒ Object
142
143
144
145
146
|
# File 'lib/orient.rb', line 142
def delete_if &b
super &b
@orient.update set:{ @name => self}
end
|