Class: TZInfo::Data::TZDataLink
- Inherits:
-
TZDataDefinition
- Object
- TZDataDefinition
- TZInfo::Data::TZDataLink
- Includes:
- TZDataParserUtils
- Defined in:
- lib/tzinfo/data/tzdataparser.rb
Overview
A tz data Link.
Instance Attribute Summary collapse
-
#link_to ⇒ Object
readonly
Returns the value of attribute link_to.
Attributes inherited from TZDataDefinition
#name, #name_elements, #path_elements
Instance Method Summary collapse
-
#initialize(name, link_to) ⇒ TZDataLink
constructor
A new instance of TZDataLink.
-
#write_index_record(file) ⇒ Object
Writes an index record for this link.
-
#write_module(output_dir) ⇒ Object
Writes a module for this link.
Methods inherited from TZDataDefinition
Constructor Details
#initialize(name, link_to) ⇒ TZDataLink
Returns a new instance of TZDataLink.
629 630 631 632 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 629 def initialize(name, link_to) super(name) @link_to = link_to end |
Instance Attribute Details
#link_to ⇒ Object (readonly)
Returns the value of attribute link_to.
627 628 629 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 627 def link_to @link_to end |
Instance Method Details
#write_index_record(file) ⇒ Object
Writes an index record for this link.
644 645 646 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 644 def write_index_record(file) file.puts(" linked_timezone #{quote_str(@name)}") end |
#write_module(output_dir) ⇒ Object
Writes a module for this link.
635 636 637 638 639 640 641 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 635 def write_module(output_dir) puts "writing link #{name}" create_file(output_dir) {|file| file.puts("linked_timezone #{quote_str(@name)}, #{quote_str(@link_to.name)}") } end |