Class: Todo::Format

Inherits:
Struct
  • Object
show all
Includes:
Helpers::Hash::Format, Helpers::Object::Presence
Defined in:
lib/todo/format.rb

Constant Summary collapse

FORMATS =
{
  full:  [:status, :text, :tags, :id],
  short: [:status, :done_date, :text]
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Hash::Format

#to_pairs

Methods included from Helpers::Object::Presence

#blank?, #present?

Instance Attribute Details

#itemsObject

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



6
7
8
# File 'lib/todo/format.rb', line 6

def items
  @items
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



6
7
8
# File 'lib/todo/format.rb', line 6

def opts
  @opts
end

Instance Method Details

#applyObject



14
15
16
# File 'lib/todo/format.rb', line 14

def apply
  items.map { |item| format(item) }
end