Sha256: d9c9fcaa086a647bfdd3c9268f647181ef0c379254c60e3cea90697edf7935c3

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

module TryApi
  class Method < TryApi::Base
    typesafe_accessor :title, String
    typesafe_accessor :description, String
    typesafe_accessor :parameters, Array, items_type: TryApi::Parameter
    typesafe_accessor :headers, Array, items_type: TryApi::Header
    typesafe_accessor :path, String
    typesafe_accessor :method, String
    typesafe_accessor :example_responses, Array, items_type: TryApi::ExampleResponse

    def to_json
      super.merge local_path: local_path, full_path: full_path
    end

    def full_path
      "#{ project.endpoint }/#{ project.api_prefix }#{ self.path }"
    end

    def local_path
      "/#{ self.project.api_prefix }#{ self.path }"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
try_api-0.1.3 app/models/try_api/method.rb
try_api-0.1.2 app/models/try_api/method.rb
try_api-0.1.1 app/models/try_api/method.rb