Module: Refried::Puter::ClassMethods

Defined in:
lib/refried/puter.rb

Constant Summary collapse

SUPPORTED_MODES =
[:simple, :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



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

def puter_mode
  @puter_mode ||= :simple
end

#puter_mode=(mode) ⇒ Object

Set the mode of function that the Puter should follow

Parameters:

  • mode (Symbol)

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



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

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