Class: DevArchive::Formatters::Show

Inherits:
Object
  • Object
show all
Defined in:
lib/dev_archive/formatters.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Show



29
30
31
# File 'lib/dev_archive/formatters.rb', line 29

def initialize()
   = 
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



28
29
30
# File 'lib/dev_archive/formatters.rb', line 28

def 
  
end

Class Method Details

.call(metadata) ⇒ Object



24
25
26
# File 'lib/dev_archive/formatters.rb', line 24

def self.call()
  new().call
end

Instance Method Details

#callObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/dev_archive/formatters.rb', line 33

def call
  id = .fetch("id")
  timestamp = Time.parse(.fetch("timestamp")).strftime("%F %H:%M")
  message = .fetch("message")

  Cfg.shell.puts(
    [
      "id: #{id}",
      "time: #{timestamp}",
      "----------------------",
      message
    ].join("\n")
  )
end