Class: TZInfo::TZDataLink

Inherits:
TZDataDefinition show all
Defined in:
lib/tzinfo/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.



552
553
554
555
# File 'lib/tzinfo/tzdataparser.rb', line 552

def initialize(name, link_to)
  super(name)
  @link_to = link_to
end

Instance Attribute Details

:nodoc:



550
551
552
# File 'lib/tzinfo/tzdataparser.rb', line 550

def link_to
  @link_to
end

Instance Method Details

#write_index_record(file) ⇒ Object

Writes an index record for this link.



567
568
569
# File 'lib/tzinfo/tzdataparser.rb', line 567

def write_index_record(file)
  file.puts("      linked_timezone #{TZDataParser.quote_str(@name)}")
end

#write_module(output_dir) ⇒ Object

Writes a module for this link.



558
559
560
561
562
563
564
# File 'lib/tzinfo/tzdataparser.rb', line 558

def write_module(output_dir)
  puts "writing link #{name}"
        
  create_file(output_dir) {|file|
    file.puts("linked_timezone #{TZDataParser.quote_str(@name)}, #{TZDataParser.quote_str(@link_to.name)}")        
  }
end