Method: CSL::Info#update!

Defined in:
lib/csl/info.rb

#update!(timestamp = Time.now) ⇒ self

Sets the updated_at timestamp.

Returns:

  • (self)


113
114
115
116
117
118
119
120
121
122
123
# File 'lib/csl/info.rb', line 113

def update!(timestamp = Time.now)
  ts = timestamp.respond_to?(:xmlschema) ? timestamp.xmlschema : timestamp.to_s

  if has_updated?
    updated.text = ts
  else
    add_child Updated.new { |u| u.text = ts }
  end

  self
end