class TrackingNumber::Info

Public Class Methods

new(info_hash = {}) click to toggle source
# File lib/tracking_number/info.rb, line 3
def initialize(info_hash = {})
  info_hash.keys.each do |key|
    self.instance_variable_set("@#{key}", info_hash[key])
    self.class_eval { attr_accessor key }
  end

  if info_hash.keys.size == 1
    @default = info_hash[info_hash.keys.first]
  end
end

Public Instance Methods

method_missing(*args) click to toggle source
# File lib/tracking_number/info.rb, line 14
def method_missing(*args)
  nil
end
to_json() click to toggle source
# File lib/tracking_number/info.rb, line 22
def to_json

end
to_s() click to toggle source
# File lib/tracking_number/info.rb, line 18
def to_s
  @default || @name
end