Sha256: 8ba3b8ba1b0518d2a9f4c7b069d53aca055bd9e2fd92d53fceea649e3b08ad22

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

module Nusii
  module ApiOperations
    class NestedIndex < Index

      attr_reader :resource_class, :nested_resource_id,
                  :nested_resource_class, :options

      def initialize resource_class, nested_resource_id, nested_resource_class, options={}
        @resource_class        = resource_class
        @nested_resource_id    = nested_resource_id
        @nested_resource_class = nested_resource_class
        @options               = options
      end

    private

      def resource_path
        "/api/v2/#{nested_resource_url_string}/#{nested_resource_id}/#{resource_url_string}"
      end

      def nested_resource_url_string
        nested_resource_class.class_name.downcase.pluralize
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nusii-0.1.1 lib/nusii/api_operations/nested_index.rb