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.
116
117
118
119
120
121
122
123
124
125
|
# File 'lib/orient.rb', line 116
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
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# File 'lib/orient.rb', line 128
def []= key, value
puts " i will handle this in the future"
super key, value
@orient.update set:{ @name => self}
end
|
#delete(key) ⇒ Object
142
143
144
145
|
# File 'lib/orient.rb', line 142
def delete key
super key
@orient.update set:{ @name => self}
end
|
#delete_if(&b) ⇒ Object
147
148
149
150
151
|
# File 'lib/orient.rb', line 147
def delete_if &b
super &b
@orient.update set:{ @name => self}
end
|