Sha256: e4587874969b34d3431b1cb65d5da446c8e111b80bfd27071eebe8d0a2b53093

Contents?: true

Size: 949 Bytes

Versions: 4

Compression:

Stored size: 949 Bytes

Contents

module Signaling
  class Base
    include Virtus.model
    extend ActiveModel::Naming
    extend ActiveModel::Translation

    autoload :Errors,       'signaling/base/errors'
    autoload :Finders,      'signaling/base/finders'
    autoload :Http,         'signaling/base/http'
    autoload :Persistence,  'signaling/base/persistence'
    autoload :UseApi,       'signaling/base/use_api'

    include Base::Errors
    include Base::Finders
    include Base::Http
    include Base::Persistence
    include Base::UseApi

    attribute :id, String

    define_action :index,   method: :get,    path: ":route_key.json"
    define_action :create,  method: :post,   path: ":route_key.json"
    define_action :show,    method: :get,    path: ":route_key/:id.json"
    define_action :update,  method: :put,    path: ":route_key/:id.json"
    define_action :destroy, method: :delete, path: ":route_key/:id.json"

    def to_param
      id
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
signaling-1.1.2 lib/signaling/base.rb
signaling-1.1.1 lib/signaling/base.rb
signaling-1.1.0 lib/signaling/base.rb
signaling-1.0.0 lib/signaling/base.rb