Module: Psychgus::Stylables::MapFlowStylable
- Includes:
- StyleStylable
- Defined in:
- lib/psychgus/stylables.rb
Overview
A FLOW style changer for Mappings only.
Constant Summary
Constants included from Psychgus::Styler
Instance Attribute Summary
Attributes included from StyleStylable
Instance Method Summary collapse
-
#initialize(min_level = 0, new_style: nil, **kargs) ⇒ Object
max_level
is not defined because a parent’s style will override all of its children. -
#style_mapping(sniffer, node) ⇒ Object
Change the style of a Mapping to FLOW (or to the value of StyleStylable#new_style) if it is >= StyleStylable#min_level.
Methods included from StyleStylable
Methods included from Psychgus::Styler
#style, #style_alias, #style_document, #style_scalar, #style_sequence, #style_stream
Instance Method Details
#initialize(min_level = 0, new_style: nil, **kargs) ⇒ Object
max_level
is not defined because a parent’s style will override all of its children.
If new_style
is nil (the default), then MAPPING_FLOW will be used.
174 175 176 177 178 |
# File 'lib/psychgus/stylables.rb', line 174 def initialize(*) super @new_style = MAPPING_FLOW if @new_style.nil? end |
#style_mapping(sniffer, node) ⇒ Object
Change the style of a Mapping to FLOW (or to the value of StyleStylable#new_style) if it is >= StyleStylable#min_level.
185 186 187 |
# File 'lib/psychgus/stylables.rb', line 185 def style_mapping(sniffer,node) change_style(sniffer,node) end |