Class: Cogger::Formatters::Property

Inherits:
Abstract
  • Object
show all
Defined in:
lib/cogger/formatters/property.rb

Overview

Formats as key=value output.

Constant Summary collapse

TEMPLATE =
nil

Constants inherited from Abstract

Abstract::NEW_LINE, Abstract::SANITIZERS

Instance Method Summary collapse

Constructor Details

#initialize(template = TEMPLATE, parser: Parsers::Position.new) ⇒ Property

Returns a new instance of Property.



11
12
13
14
15
# File 'lib/cogger/formatters/property.rb', line 11

def initialize template = TEMPLATE, parser: Parsers::Position.new
  super()
  @template = template
  @parser = parser
end

Instance Method Details

#call(*input) ⇒ Object



17
18
19
20
21
22
# File 'lib/cogger/formatters/property.rb', line 17

def call(*input)
  *, entry = input
  attributes = sanitize(entry, :tagged_attributes).tap(&:compact!)

  concat(attributes).chop! << NEW_LINE
end