Class: JSONHasher::Parser
- Inherits:
-
Object
- Object
- JSONHasher::Parser
- Defined in:
- lib/json_hasher.rb
Instance Method Summary collapse
-
#initialize(json_string) ⇒ Parser
constructor
A new instance of Parser.
- #to_sha2 ⇒ Object
Constructor Details
#initialize(json_string) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 |
# File 'lib/json_hasher.rb', line 7 def initialize(json_string) raise 'JSONHasher only takes a String' unless json_string.is_a?(String) @parsed_json = JSON.parse(json_string) end |
Instance Method Details
#to_sha2 ⇒ Object
12 13 14 |
# File 'lib/json_hasher.rb', line 12 def to_sha2 hash_parsed_json(@parsed_json) end |