Class: TZInfo::Data::TZDataLink

Inherits:
TZDataDefinition show all
Includes:
TZDataParserUtils
Defined in:
lib/tzinfo/data/tzdataparser.rb

Overview

A tz data Link.

Instance Attribute Summary collapse

Attributes inherited from TZDataDefinition

#name, #name_elements, #path_elements

Instance Method Summary collapse

Methods inherited from TZDataDefinition

#create_file

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

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