Sha256: 8c2949e2a1c5e3be8aeb7ca48be62fbacfa9e63cd19afaeb88b83aeefbc0739c

Contents?: true

Size: 259 Bytes

Versions: 2

Compression:

Stored size: 259 Bytes

Contents

module PageMeta
  class Action
    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

2 entries across 2 versions & 1 rubygems

Version Path
page_meta-0.1.1 lib/page_meta/action.rb
page_meta-0.1.0 lib/page_meta/action.rb