Module: Refried::Puter::ClassMethods

Defined in:
lib/refried/puter.rb

Constant Summary collapse

SUPPORTED_MODES =
[:simple, :tube_name, :type_map, :alias_map]

Instance Method Summary collapse

Instance Method Details

#puter_modeSymbol

Get the current mapping mode of the Puter

Returns:

  • (Symbol)

    the current mapping mode of the Puter



27
28
29
# File 'lib/refried/puter.rb', line 27

def puter_mode
  @puter_mode ||= :simple
end

#puter_mode=(mode) ⇒ Object Also known as: put_mode

Set the mode of function that the Puter should follow

Parameters:

  • mode (Symbol)

    which mapping mode the puter uses, :simple, :type_map, :alias_map, or :tube_name



17
18
19
20
21
22
# File 'lib/refried/puter.rb', line 17

def puter_mode=(mode)
  unless SUPPORTED_MODES.include? mode
    raise ArgumentError, "Unsupported mode for acts as puter."
  end
  @puter_mode = mode
end