Module: Ribbon::CoreExtensions::Hash

Defined in:
lib/ribbon/core_extensions/hash.rb

Overview

Includes methods to convert hashes to ribbons.

Author:

  • Matheus Afonso Martins Moreira

Since:

  • 0.6.0

Instance Method Summary collapse

Instance Method Details

#to_raw_ribbonRibbon::Raw

Converts this hash to a raw ribbon.

Returns:

  • (Ribbon::Raw)

    a new raw ribbon with the contents of this hash

Since:

  • 0.8.0



25
26
27
# File 'lib/ribbon/core_extensions/hash.rb', line 25

def to_raw_ribbon
  Ribbon.wrap self
end

#to_ribbonRibbon Also known as: to_rbon

Converts this hash to a ribbon.

Returns:

  • (Ribbon)

    a new ribbon with the contents of this hash

Since:

  • 0.6.0



15
16
17
# File 'lib/ribbon/core_extensions/hash.rb', line 15

def to_ribbon
  Ribbon.new self
end