Sha256: a63128a34cdf302cf88a541625c8f00d3dabe48e5b6d22da5f8bcf2d7b76a5a4

Contents?: true

Size: 676 Bytes

Versions: 24

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module FmRest
  module Spyke
    module Model
      module Uri
        extend ::ActiveSupport::Concern

        class_methods do
          # Accessor for FM layout (helps with building the URI)
          #
          def layout(layout = nil)
            @layout = layout if layout
            @layout ||= model_name.name
          end

          # Extend uri acccessor to default to FM Data schema
          #
          def uri(uri_template = nil)
            if @uri.nil? && uri_template.nil?
              return FmRest::V1.record_path(layout) + "(/:id)"
            end

            super
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fmrest-0.11.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.11.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.10.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.10.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.9.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.8.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.7.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.7.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.6.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.5.2 lib/fmrest/spyke/model/uri.rb
fmrest-0.5.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.5.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.4.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.4.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.3.3 lib/fmrest/spyke/model/uri.rb
fmrest-0.3.2 lib/fmrest/spyke/model/uri.rb
fmrest-0.3.1 lib/fmrest/spyke/model/uri.rb
fmrest-0.3.0 lib/fmrest/spyke/model/uri.rb
fmrest-0.2.5 lib/fmrest/spyke/model/uri.rb
fmrest-0.2.4 lib/fmrest/spyke/model/uri.rb