Class: HttpStub::Server::FormattedHash
- Inherits:
-
Hash
- Object
- Hash
- HttpStub::Server::FormattedHash
- Defined in:
- lib/http_stub/server/formatted_hash.rb
Instance Method Summary collapse
-
#initialize(hash, key_value_delimiter) ⇒ FormattedHash
constructor
A new instance of FormattedHash.
- #to_s ⇒ Object
Constructor Details
#initialize(hash, key_value_delimiter) ⇒ FormattedHash
Returns a new instance of FormattedHash.
6 7 8 9 |
# File 'lib/http_stub/server/formatted_hash.rb', line 6 def initialize(hash, key_value_delimiter) self.merge!(hash || {}) @key_value_delimiter = key_value_delimiter end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/http_stub/server/formatted_hash.rb', line 11 def to_s self.map { |key_and_value| key_and_value.map(&:to_s).join(@key_value_delimiter) }.join(", ") end |