Class: TXTextControl::ReportingCloud::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/txtextcontrol/reportingcloud/template.rb

Overview

Holds information about a template in the template storage.

Author:

  • Thorsten Kummerow (@thomerow)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_name, modified, size) ⇒ Template

Returns a new instance of Template



30
31
32
33
34
35
36
37
38
# File 'lib/txtextcontrol/reportingcloud/template.rb', line 30

def initialize(template_name, modified, size)
  @template_name = template_name
  if modified.is_a?(DateTime)
    @modified = modified
  else
    @modified = DateTime.iso8601(modified) 
  end
  @size = size
end

Instance Attribute Details

#modifiedDateTime (readonly)

The date and time the template file was last modified.

Returns:

  • (DateTime)

    the current value of modified



25
26
27
# File 'lib/txtextcontrol/reportingcloud/template.rb', line 25

def modified
  @modified
end

#sizeInteger (readonly)

The size of the template file in bytes.

Returns:

  • (Integer)

    the current value of size



25
26
27
# File 'lib/txtextcontrol/reportingcloud/template.rb', line 25

def size
  @size
end

#template_nameString (readonly)

The template file name.

Returns:

  • (String)

    the current value of template_name



25
26
27
# File 'lib/txtextcontrol/reportingcloud/template.rb', line 25

def template_name
  @template_name
end