Class: Arstotzka::HashReader Private
- Inherits:
-
Object
- Object
- Arstotzka::HashReader
- Includes:
- Base
- Defined in:
- lib/arstotzka/hash_reader.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for reading json / hash from instance
Instance Attribute Summary collapse
- #options ⇒ Object readonly private private
Instance Method Summary collapse
-
#hash ⇒ Hash
private
Retrieves the hash to be crawled from the instance.
-
#initialize(options_hash = {}) ⇒ HashReader
constructor
private
Returns a new instance of HashReader.
Methods included from Base
Constructor Details
#iniitalize(options_hash = {}) ⇒ HashReader #iniitalize(options) ⇒ HashReader
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.
Returns a new instance of HashReader
17 18 19 |
# File 'lib/arstotzka/hash_reader.rb', line 17 def initialize( = {}) self. = end |
Instance Attribute Details
#options ⇒ Object (readonly, private)
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.
75 76 77 |
# File 'lib/arstotzka/hash_reader.rb', line 75 def @options end |
Instance Method Details
#hash ⇒ Hash
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.
Retrieves the hash to be crawled from the instance
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/arstotzka/hash_reader.rb', line 62 def hash @hash ||= case json.to_s when /^@@.*/ instance.class.class_variable_get(json) when /^@.*/ instance.instance_variable_get(json) else instance.send(json) end end |