Method: Ppp.card

Defined in:
lib/ppp.rb

.card(type, *args) ⇒ Object

Returns a Card of the given type.

Parameters:

  • type (Symbol)

    the type of card to return

  • args (Array)

    parameters to pass to the card’s constructor

Returns:

  • a Card of the given type

Raises:

  • (ArgumentError)


34
35
36
37
38
39
40
41
# File 'lib/ppp.rb', line 34

def card type, *args
  case type
  when :html  then return Card::Html.new  *args
  when :xml   then return Card::Xml.new   *args
  when :plain then return Card::Plain.new *args
  end
  raise ArgumentError.new( "%s is not a valid printer style." % style )
end