class Fit4Ruby::GlobalFitDictList

Public Class Methods

new(&block) click to toggle source
# File lib/fit4ruby/GlobalFitDictList.rb, line 42
def initialize(&block)
  @current_dict = nil
  @dicts = {}
  instance_eval(&block) if block_given?
end

Public Instance Methods

[](name) click to toggle source
# File lib/fit4ruby/GlobalFitDictList.rb, line 62
def [](name)
  @dicts[name]
end
dict(name) click to toggle source
# File lib/fit4ruby/GlobalFitDictList.rb, line 48
def dict(name)
  if @dicts.include?(name)
    Log.fatal "Dictionary #{name} has already been defined"
  end
  @dicts[name] = @current_dict = GlobalFitDict.new
end
entry(number, name) click to toggle source
# File lib/fit4ruby/GlobalFitDictList.rb, line 55
def entry(number, name)
  unless @current_dict
    Log.fatal "You must define a dictionary first"
  end
  @current_dict.entry(number, name)
end