class RadiusRB::Attribute

Attributes

id[R]
name[R]
type[R]
vendor[R]

Public Class Methods

new(name, id, type, vendor=nil) click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 43
def initialize(name, id, type, vendor=nil)
  @values = ValuesCollection.new
  @name = name
  @id = id.to_i
  @type = type
  @vendor = vendor if vendor
end

Public Instance Methods

add_value(name, id) click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 51
def add_value(name, id)
  @values.add(name, id.to_i)
end
find_values_by_id(id) click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 59
def find_values_by_id(id)
  @values.find_by_id(id.to_i)
end
find_values_by_name(name) click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 55
def find_values_by_name(name)
  @values.find_by_name(name)
end
has_values?() click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 63
def has_values?
  !@values.empty?
end
values() click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 67
def values
  @values
end
vendor?() click to toggle source
# File lib/radiusrb/dictionary/attributes.rb, line 71
def vendor?
  !!@vendor
end