class TZInfo::TZDataFormat

:nodoc:
substitution (%s) format or a fixed string.
A tz data Zone format string. Either alternate standard/daylight-savings,

def expand(std_offset, rule_string)

Expands given the current daylight savings offset and Rule string.
def expand(std_offset, rule_string)
  if @type == :alternate
    if std_offset == 0
      @standard_abbrev
    else
      @daylight_abbrev
    end
  elsif @type == :subst
    sprintf(@abbrev, rule_string)
  else
    @abbrev
  end        
end

def fixed?

Is a fixed format string.
def fixed?
  @type == :fixed
end

def initialize(spec)

:nodoc:
substitution (%s) format or a fixed string.
A tz data Zone format string. Either alternate standard/daylight-savings,
def initialize(spec)
  if spec =~ /([A-z]+)\/([A-z]+)/
    @type = :alternate
    @standard_abbrev = $1
    @daylight_abbrev = $2
  elsif spec =~ /%s/
    @type = :subst
    @abbrev = spec
  else
    @type = :fixed
    @abbrev = spec
  end
end

def requires_rule_string?

True if a string from the rule is required to expand this format.
def requires_rule_string?
  @type == :subst
end