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.
189 190 191 192 193 |
# File 'lib/psychgus/stylables.rb', line 189 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.
200 201 202 |
# File 'lib/psychgus/stylables.rb', line 200 def style_mapping(sniffer,node) change_style(sniffer,node) end |