Class: Psychgus::Stylers::NoSymStyler

Inherits:
Object
  • Object
show all
Includes:
Psychgus::Stylables::NoSymStylable
Defined in:
lib/psychgus/stylers.rb

Overview

A Symbol remover for Scalars.

Examples:

require 'psychgus'

data = {
  :eggs => {
    :styles => ['Fried', 'Scrambled', ['BBQ', 'Ketchup']],
    :colors => ['Brown', 'White', ['Blue', 'Green']]
}}

flow = Psychgus::FlowStyler.new(4)

puts data.to_yaml(stylers: [Psychgus::NoSymStyler.new,flow])

# Output:
# ---
# Eggs:
#   Styles: [Fried, Scrambled, [BBQ, Ketchup]]
#   Colors: [Brown, White, [Blue, Green]]

puts data.to_yaml(stylers: [Psychgus::NoSymStyler.new(cap: false),flow])

# ---
# eggs:
#   styles: [Fried, Scrambled, [BBQ, Ketchup]]
#   colors: [Brown, White, [Blue, Green]]

See Also:

Since:

  • 1.2.0

Constant Summary

Constants included from Psychgus::Styler

Psychgus::Styler::EMPTY

Instance Attribute Summary

Attributes included from Psychgus::Stylables::NoSymStylable

#cap

Method Summary

Methods included from Psychgus::Stylables::NoSymStylable

#initialize, #style_scalar

Methods included from Psychgus::Styler

#style, #style_alias, #style_document, #style_mapping, #style_scalar, #style_sequence, #style_stream