Class: PageMeta::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/page_meta/action.rb

Constant Summary collapse

ALIASES =

rubocop:disable Style/MutableConstant

{
  "update" => "edit",
  "create" => "new",
  "destroy" => "remove"
}

Instance Method Summary collapse

Constructor Details

#initialize(action) ⇒ Action

rubocop:enable Style/MutableConstant



13
14
15
# File 'lib/page_meta/action.rb', line 13

def initialize(action)
  @action = action
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/page_meta/action.rb', line 17

def to_s
  ALIASES[@action] || @action
end