Class: AwesomeXML::Duration::Format::StaticChunk

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_xml/duration/format/static_chunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStaticChunk

Returns a new instance of StaticChunk.



11
12
13
# File 'lib/awesome_xml/duration/format/static_chunk.rb', line 11

def initialize
  @format_chars = []
end

Instance Attribute Details

#format_charsObject

Returns the value of attribute format_chars.



9
10
11
# File 'lib/awesome_xml/duration/format/static_chunk.rb', line 9

def format_chars
  @format_chars
end

Instance Method Details

#dynamic?Boolean

Counterpart of the same method of ‘AwesomeXML::Duration::Format::DynamicChunk`. Used to differentiate between instances of these two classes.

Returns:

  • (Boolean)


27
28
29
# File 'lib/awesome_xml/duration/format/static_chunk.rb', line 27

def dynamic?
  false
end

#parse_lengthObject

Returns the number of the defining characters.



21
22
23
# File 'lib/awesome_xml/duration/format/static_chunk.rb', line 21

def parse_length
  format_chars.length
end

#to_sObject

Returns the defining characters joint into a string.



16
17
18
# File 'lib/awesome_xml/duration/format/static_chunk.rb', line 16

def to_s
  format_chars.join
end