module Characterize::Controller

Public Class Methods

included(klass) click to toggle source
# File lib/characterize/controller.rb, line 3
def self.included(klass)
  klass.extend(::Characterize::ControllerMacros)
end

Private Instance Methods

characterize(obj, *mods) click to toggle source
# File lib/characterize/controller.rb, line 9
def characterize(obj, *mods)
  obj.__set_characterize_view__(view_context).cast_as(*mods)
  obj
end
characters_for_action(object_name, action_name) click to toggle source
# File lib/characterize/controller.rb, line 14
def characters_for_action(object_name, action_name)
  if self.respond_to?("#{object_name}_#{action_name}_features") && action_methods.include?(action_name.to_s)
    Array(self.send("#{object_name}_#{action_name}_features"))
  else
    self.send("default_#{object_name}_features")
  end
end