Module: Jade::Formatter::Literal

Extended by:
Helper, Literal
Included in:
Literal
Defined in:
lib/jade/formatter/leaves.rb

Instance Method Summary collapse

Methods included from Helper

and_indent, dispatch_for, format_delimited, format_exposing, format_leading_comments, format_node, format_pattern, format_trailing_comment, format_type, format_type_atom, too_long?

Instance Method Details

#format(node, indent:, source:) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/jade/formatter/leaves.rb', line 37

def format(node, indent:, source:)
  case node.value
  in Integer | Float then node.value.to_s
  in TrueClass       then "True"
  in FalseClass      then "False"
  in String          then node.value.inspect
  end
    .then(&and_indent(indent))
end