class Barr::Blocks::Clock

Public Class Methods

new(opts = {}) click to toggle source
Calls superclass method Barr::Block::new
# File lib/barr/blocks/clock.rb, line 7
def initialize(opts = {})
  super
  @format = opts[:format] || '%H:%M %d %b %Y'
end

Public Instance Methods

update!() click to toggle source
# File lib/barr/blocks/clock.rb, line 12
def update!
  @output = Time.now.strftime(@format)
end