Class: PopCap::FormattedHash
- Inherits:
-
Object
- Object
- PopCap::FormattedHash
- Defined in:
- lib/pop_cap/formatted_hash.rb
Overview
Public: This class will apply all Formatters to the supplied hash.
new - Supply an unformatted hash.
Class Method Summary collapse
-
.formatted(unformatted) ⇒ Object
Public: This wraps #new & #formatted.
Instance Method Summary collapse
-
#formatted ⇒ Object
Public: This class will apply all Formatters to the supplied hash.
-
#initialize(unformatted) ⇒ FormattedHash
constructor
A new instance of FormattedHash.
Constructor Details
#initialize(unformatted) ⇒ FormattedHash
Returns a new instance of FormattedHash.
11 12 13 |
# File 'lib/pop_cap/formatted_hash.rb', line 11 def initialize(unformatted) @unformatted = unformatted end |
Class Method Details
.formatted(unformatted) ⇒ Object
Public: This wraps #new & #formatted.
24 25 26 |
# File 'lib/pop_cap/formatted_hash.rb', line 24 def self.formatted(unformatted) new(unformatted).formatted end |
Instance Method Details
#formatted ⇒ Object
Public: This class will apply all Formatters to the supplied hash.
18 19 20 |
# File 'lib/pop_cap/formatted_hash.rb', line 18 def formatted @unformatted.merge(formatted_hash) end |