class Wurfl::Command::Inspector::WurflInspector

A class that lists wurfl handsets that match user specified search criteria.

Public Class Methods

new(handsets) click to toggle source

Constructor Parameters: handsets: A hashtable of wurfl handsets indexed by wurfl_id.

# File lib/wurfl/command/inspector.rb, line 17
def initialize(handsets)
  @handsets = handsets
end

Public Instance Methods

get_handset(id) click to toggle source

A method to get the WurflHandset that matches the passed wurfl_id. Parameters: id: is the wurfl_id of the WurflHandset to get. Returns: The WurflHandset that has the requested wurfl_id. If the wurfl_id is not found, then nil is returned.

# File lib/wurfl/command/inspector.rb, line 27
def get_handset(id)
  return @handsets[id]
end
search_handsets(proc) click to toggle source

A method to retrieve a list of the inspector's handsets that match the passed search criteria. Parameters: proc: is a Proc object that defines a function that returns true or false from an evaluattion with a WurflHandset. Returns: An Array of all WurflHandsets that match the proc evaluation.

# File lib/wurfl/command/inspector.rb, line 38
def search_handsets(proc)
  rez = @handsets.values.select do |hand|  
    x = proc.call(hand)       
  end
  return rez if rez != nil
  return Array::new
end