class RadiusRB::ValuesCollection

Public Class Methods

new() click to toggle source
# File lib/radiusrb/dictionary/values.rb, line 5
def initialize
  @collection = {}
  @revcollection = {}
end

Public Instance Methods

add(name, id) click to toggle source
# File lib/radiusrb/dictionary/values.rb, line 10
def add(name, id)
  @collection[name] ||= Value.new(name, id)
  @revcollection[id.to_i] ||= @collection[name]
  self << @collection[name]
end
empty?() click to toggle source
# File lib/radiusrb/dictionary/values.rb, line 24
def empty?
  @collection.empty?
end
find_by_id(id) click to toggle source
# File lib/radiusrb/dictionary/values.rb, line 20
def find_by_id(id)
  @revcollection[id]
end
find_by_name(name) click to toggle source
# File lib/radiusrb/dictionary/values.rb, line 16
def find_by_name(name)
  @collection[name]
end