Class: Elastomer::Client::RestApiSpec::RestApi

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/elastomer/client/rest_api_spec/rest_api.rb

Defined Under Namespace

Classes: Url

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(documentation:, methods:, url:, body: nil) ⇒ RestApi

Returns a new instance of RestApi.



15
16
17
18
19
20
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 15

def initialize(documentation:, methods:, url:, body: nil)
  @documentation = documentation
  @methods = Array(methods)
  @url = Url.new(url)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 10

def body
  @body
end

#documentationObject (readonly)

Returns the value of attribute documentation.



7
8
9
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 7

def documentation
  @documentation
end

#methodsObject (readonly)

Returns the value of attribute methods.



8
9
10
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 8

def methods
  @methods
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 9

def url
  @url
end

Instance Method Details

#body?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/elastomer/client/rest_api_spec/rest_api.rb', line 22

def body?
  !body.nil?
end