Sha256: a6ffd2195fee334f5f049d5bbfd5d872dd63fd00e3c73200ac0ae081a9e00b35

Contents?: true

Size: 435 Bytes

Versions: 1

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true

module Logux
  class Action < ::ActionController::Parameters
    def action_name
      type&.split('/')&.dig(0)
    end

    def action_type
      type&.split('/')&.last
    end

    def channel_name
      channel&.split('/')&.dig(0)
    end

    def channel_id
      channel&.split('/')&.last
    end

    def type
      require(:type)
    end

    def channel
      require(:channel)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logux_rails-0.2.0 lib/logux/action.rb