Module: Ribbon::CoreExtensions::Array
- Defined in:
- lib/ribbon/core_extensions/array.rb
Overview
Methods to work with ribbons in arrays.
Instance Method Summary collapse
-
#extract_raw_ribbon! ⇒ Ribbon::Raw
(also: #extract_options_as_raw_ribbon!)
Extracts the last argument as a raw ribbon or returns an empty one.
-
#extract_ribbon! ⇒ Ribbon
(also: #extract_options_as_ribbon!)
Extracts the last argument as a ribbon or returns an empty one.
Instance Method Details
#extract_raw_ribbon! ⇒ Ribbon::Raw Also known as: extract_options_as_raw_ribbon!
Extracts the last argument as a raw ribbon or returns an empty one.
31 32 33 |
# File 'lib/ribbon/core_extensions/array.rb', line 31 def extract_raw_ribbon! Ribbon::Raw.new extract_ribbon! end |
#extract_ribbon! ⇒ Ribbon Also known as: extract_options_as_ribbon!
Extracts the last argument as a ribbon or returns an empty one.
16 17 18 19 20 21 22 |
# File 'lib/ribbon/core_extensions/array.rb', line 16 def extract_ribbon! case last when Hash, Ribbon::Raw then Ribbon.new pop when Ribbon then pop else Ribbon.new end end |