Method: Magicka::Aggregator::ClassMethods#type

Defined in:
lib/magicka/aggregator/class_methods.rb

#type(new_type = nil) ⇒ Symbol

Set and return the type of the aggregator

When new_type is ommited, returns the last value

Parameters:

  • new_type (Symbol, String) (defaults to: nil)

    The value to be set

Returns:

  • (Symbol)

    the type of the aggregator



22
23
24
25
26
# File 'lib/magicka/aggregator/class_methods.rb', line 22

def type(new_type = nil)
  return @type ||= default_type unless new_type

  @type = new_type.to_sym
end