Module: OasParser::RawAccessor

Included in:
AbstractAttribute, Callback, Definition, Endpoint, RequestBody, Response
Defined in:
lib/oas_parser/raw_accessor.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



7
8
9
10
# File 'lib/oas_parser/raw_accessor.rb', line 7

def method_missing(method_name, *args, &block)
  super unless self.class.get_raw_keys.include? method_name
  raw[method_name.to_s]
end

Class Method Details

.included(klass) ⇒ Object



3
4
5
# File 'lib/oas_parser/raw_accessor.rb', line 3

def self.included(klass)
  klass.extend ClassMethods
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/oas_parser/raw_accessor.rb', line 12

def respond_to_missing?(method_name, include_private = false)
  self.class.get_raw_keys.include?(method_name) || super
end