lib/rtsp/response.rb
# Creates an attr_reader with the name given and sets it to the value
# that's given.
#
# @param [String] name
# @param [String,Hash] value
Creates an attr_reader with the name given and sets it to the value
that's given.
Creates an attr_reader with the name given and sets it to the value that ' s given .
def create_reader(name, value)
      unless value.empty?
        if value.is_a? String
          value = value =~ /^[0-9]*$/ ? value.to_i : value
        end
      end
      instance_variable_set("@#{name}", value)
      self.instance_eval "def #{name}; @#{name}; end"
    end
def create_reader ( name , value ) unless value . empty? if value . is_a? String value = value =~ / ^[0-9]*$ / ? value . to_i : value end end instance_variable_set ( "@#{name}" , value ) self . instance_eval "def #{name}; @#{name}; end" end
Creates an attr_reader with the name given and sets it to the value
that's given.
Creates an attr_reader with the name given and sets it to the value that ' s given .
name
value
None