Module: Cequel::Util::HashAccessors Private
- Included in:
- Record::RecordSet
- Defined in:
- lib/cequel/util.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #hattr_accessor(hash, *attributes) ⇒ Object private
- #hattr_inquirer(hash, *attributes) ⇒ Object private
- #hattr_reader(hash, *attributes) ⇒ Object private
- #hattr_writer(hash, *attributes) ⇒ Object private
Instance Method Details
#hattr_accessor(hash, *attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 46 |
# File 'lib/cequel/util.rb', line 43 def hattr_accessor(hash, *attributes) hattr_reader(hash, *attributes) hattr_writer(hash, *attributes) end |
#hattr_inquirer(hash, *attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 28 29 30 31 |
# File 'lib/cequel/util.rb', line 23 def hattr_inquirer(hash, *attributes) attributes.each do |attribute| module_eval " def \#{attribute}?\n !!\#{hash}[\#{attribute.to_sym.inspect}]\n end\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |
#hattr_reader(hash, *attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 |
# File 'lib/cequel/util.rb', line 13 def hattr_reader(hash, *attributes) attributes.each do |attribute| module_eval " def \#{attribute}\n \#{hash}[\#{attribute.to_sym.inspect}]\n end\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |
#hattr_writer(hash, *attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 41 |
# File 'lib/cequel/util.rb', line 33 def hattr_writer(hash, *attributes) attributes.each do |attribute| module_eval " def \#{attribute}=(value)\n \#{hash}[\#{attribute.to_sym.inspect}] = value\n end\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |