Class: EPIC::Handle::XHTML

Inherits:
Rackful::XHTML show all
Defined in:
src/epic_handle.rb

Constant Summary

Constant Summary

Constants inherited from Rackful::XHTML

Rackful::XHTML::CONTENT_TYPES

Instance Attribute Summary

Attributes inherited from Rackful::Serializer

#content_type, #resource

Instance Method Summary (collapse)

Methods inherited from Rackful::XHTML

#each, #footer, #header, #htmlify, #xsd_type

Methods inherited from Rackful::Serializer

#each, #initialize

Constructor Details

This class inherits a constructor from Rackful::Serializer

Instance Method Details

- (void) each_nested {|self.serialize values| ... }

:yields: strings

Yields:

  • (self.serialize values)


319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'src/epic_handle.rb', line 319

def each_nested # :yields: strings
  values = self.resource.to_a
  values.each do
    |value|
    value[:timestamp] = Time.at(value[:timestamp]).utc.xmlschema
    value[:ttl] = ( 0 == value[:ttl_type] ) ?
      value[:ttl].to_s + 's' :
      Time.at(value[:ttl]).utc.xmlschema
    value.delete :ttl_type
    value[:perms] =
      ( value[:admin_read]  ? 'r' : '-' ) +
      ( value[:admin_write] ? 'w' : '-' ) +
      ( value[:pub_read]    ? 'r' : '-' ) +
      ( value[:pub_write]   ? 'w' : '-' )
    value.delete :admin_read
    value.delete :admin_write
    value.delete :pub_read
    value.delete :pub_write
  end
  yield self.serialize values
end