module Tuxedo::ClassMethods

ClassMethods that are available in every presenter

Public Instance Methods

object_alias(name) click to toggle source

Alias method name for accessing the original object Defaults to guessing the name from the class

@param [Symbol] name alias

# File lib/tuxedo.rb, line 71
def object_alias(name)
  setup_alias_method(name || underscored_name)
end
setup_alias_method(name = underscored_name) click to toggle source

@api private Setup (after initialize) a new method for accessing the original object

# File lib/tuxedo.rb, line 86
def setup_alias_method(name = underscored_name)
  alias_method(name, :object)
end
underscored_name() click to toggle source

Guesses the name using the class name

@return [String]

# File lib/tuxedo.rb, line 79
def underscored_name
  name.demodulize.gsub(Tuxedo.config.suffix, '').underscore
end