Class: Jsapi::Meta::Defaults

Inherits:
Jsapi::Model::Base show all
Defined in:
lib/jsapi/meta/defaults.rb

Overview

Holds the default values for a particular Schema type.

Instance Method Summary collapse

Methods inherited from Jsapi::Model::Base

#==, #errors, #initialize, #inspect, model_name, #respond_to_missing?

Constructor Details

This class inherits a constructor from Jsapi::Model::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Jsapi::Model::Base

Instance Method Details

#value(context:) ⇒ Object

Returns the default value within context.



18
19
20
21
22
23
24
25
# File 'lib/jsapi/meta/defaults.rb', line 18

def value(context:)
  case context
  when :request
    within_requests
  when :response
    within_responses
  end
end

#within_requestsObject

:attr: within_requests The default value of parameters and properties when reading requests.



10
# File 'lib/jsapi/meta/defaults.rb', line 10

attribute :within_requests

#within_responsesObject

:attr: within_responses The default value of properties when writing responses.



15
# File 'lib/jsapi/meta/defaults.rb', line 15

attribute :within_responses