Class: PopCap::UnformattedHash

Inherits:
Object
  • Object
show all
Defined in:
lib/pop_cap/unformatted_hash.rb

Overview

Public: This class formats the JSON output of TagReader.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ UnformattedHash

Returns a new instance of UnformattedHash.



9
10
11
# File 'lib/pop_cap/unformatted_hash.rb', line 9

def initialize(json)
  @json = json
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



7
8
9
# File 'lib/pop_cap/unformatted_hash.rb', line 7

def json
  @json
end

Class Method Details

.hash(json) ⇒ Object

Public: This method wraps #new & #hash.



22
23
24
# File 'lib/pop_cap/unformatted_hash.rb', line 22

def self.hash(json)
  new(json).hash
end

Instance Method Details

#hashObject

Public: This method returns a Ruby hash. The keys have been converted to symbols.



16
17
18
# File 'lib/pop_cap/unformatted_hash.rb', line 16

def hash
  renamed_hash
end