Sha256: c7e7fdb53e6839e21459b3c9de1a2e930aaf6269eda0e8e7e5c3458915c1af83

Contents?: true

Size: 334 Bytes

Versions: 3

Compression:

Stored size: 334 Bytes

Contents

# frozen_string_literal: true

module PageMeta
  class Action
    # rubocop:disable Style/MutableConstant
    ALIASES = {
      "update"  => "edit",
      "create"  => "new",
      "destroy" => "remove"
    }

    def initialize(action)
      @action = action
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
page_meta-0.2.0 lib/page_meta/action.rb
page_meta-0.1.3 lib/page_meta/action.rb
page_meta-0.1.2 lib/page_meta/action.rb