class CrudResponder::CallerExtractor

Attributes

kaller[R]

Public Class Methods

new(kaller) click to toggle source
# File lib/crud_responder/caller_extractor.rb, line 5
def initialize(kaller)
  @kaller = kaller
end

Public Instance Methods

action() click to toggle source
# File lib/crud_responder/caller_extractor.rb, line 21
def action
  case name
  when /destroy/
    :destroy
  when /update/
    :update
  when /create/
    :create
  else
    name.to_sym
  end
end
method() click to toggle source
# File lib/crud_responder/caller_extractor.rb, line 13
def method
  if name =~ /destroy/
    :destroy
  else
    :save
  end
end
name() click to toggle source
# File lib/crud_responder/caller_extractor.rb, line 9
def name
  kaller[0][/`.*'/][1..-2]
end