Class: Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/tester/definition/endpoint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Endpoint

Returns a new instance of Endpoint.



10
11
12
13
14
15
16
# File 'lib/tester/definition/endpoint.rb', line 10

def initialize name
  self.name = name
  self.methods = []
  self.bad_request_response = Response.new 400
  self.not_allowed_response = Response.new 415
  self.not_found_response = Response.new 404
end

Instance Attribute Details

#bad_request_responseObject

Returns the value of attribute bad_request_response.



6
7
8
# File 'lib/tester/definition/endpoint.rb', line 6

def bad_request_response
  @bad_request_response
end

#methodsObject

Returns the value of attribute methods.



4
5
6
# File 'lib/tester/definition/endpoint.rb', line 4

def methods
  @methods
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/tester/definition/endpoint.rb', line 5

def name
  @name
end

#not_allowed_responseObject

Returns the value of attribute not_allowed_response.



7
8
9
# File 'lib/tester/definition/endpoint.rb', line 7

def not_allowed_response
  @not_allowed_response
end

#not_found_responseObject

Returns the value of attribute not_found_response.



8
9
10
# File 'lib/tester/definition/endpoint.rb', line 8

def not_found_response
  @not_found_response
end

Instance Method Details

#add_method(new_method) ⇒ Object



18
19
20
21
# File 'lib/tester/definition/endpoint.rb', line 18

def add_method(new_method)
  self.methods << new_method
  self
end