Class: Psychgus::Stylers::NoTagStyler

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

Overview

A Tag remover for classes.

Examples:

require 'psychgus'

class Eggs
  def initialize
    @styles = ['Fried', 'Scrambled', ['BBQ', 'Ketchup']]
    @colors = ['Brown', 'White', ['Blue', 'Green']]
  end
end

class EggCarton
  include Psychgus::Blueberry

  def initialize
    @eggs = Eggs.new
  end

  def psychgus_stylers(sniffer)
    Psychgus::FlowStyler.new(4)
  end
end

puts EggCarton.new.to_yaml

# Output:
# --- !ruby/object:EggCarton
# eggs: !ruby/object:Eggs
#   styles: [Fried, Scrambled, [BBQ, Ketchup]]
#   colors: [Brown, White, [Blue, Green]]

puts EggCarton.new.to_yaml(stylers: Psychgus::NoTagStyler.new)

# Output:
# ---
# 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

Method Summary

Methods included from Psychgus::Stylables::NoTagStylable

#style

Methods included from Psychgus::Styler

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