class Nipper::Evidence

Public Class Methods

new(xml_node) click to toggle source
# File lib/nipper/evidence.rb, line 3
def initialize(xml_node)
  @xml = xml_node
end

Public Instance Methods

method_missing(method, *args) click to toggle source
Calls superclass method
# File lib/nipper/evidence.rb, line 16
def method_missing(method, *args)
  unless supported_tags.include?(method)
    super
    return
  end

  field = method.to_s.split('_')[1]

  @xml.at_xpath('./device').attr(field)
end
respond_to?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/nipper/evidence.rb, line 11
def respond_to?(method, include_private = false)
  return true if supported_tags.include?(method.to_sym)
  super
end
supported_tags() click to toggle source
# File lib/nipper/evidence.rb, line 7
def supported_tags
  [ :device_name, :device_osversion, :device_type ]
end