Sha256: 4d38e8c39aeb2417382c3516efb46d4fcb6ae8e03fb3c24412d0f59382defcf8

Contents?: true

Size: 557 Bytes

Versions: 42

Compression:

Stored size: 557 Bytes

Contents

module OasParser
  module RawAccessor
    def self.included(klass)
      klass.extend ClassMethods
    end

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

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

    module ClassMethods
      def raw_keys(*args)
        @raw_keys = args
      end

      def get_raw_keys
        @raw_keys || []
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
oas_parser_reborn-0.25.5 lib/oas_parser_reborn/raw_accessor.rb
oas_parser-0.25.4 lib/oas_parser/raw_accessor.rb
oas_parser-0.25.3 lib/oas_parser/raw_accessor.rb
oas_parser-0.25.1 lib/oas_parser/raw_accessor.rb
oas_parser-0.25.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.24.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.23.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.22.4 lib/oas_parser/raw_accessor.rb
oas_parser-0.22.2 lib/oas_parser/raw_accessor.rb
oas_parser-0.22.1 lib/oas_parser/raw_accessor.rb
oas_parser-0.22.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.21.1 lib/oas_parser/raw_accessor.rb
oas_parser-0.21.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.20.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.19.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.18.2 lib/oas_parser/raw_accessor.rb
oas_parser-0.18.1 lib/oas_parser/raw_accessor.rb
oas_parser-0.18.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.17.0 lib/oas_parser/raw_accessor.rb
oas_parser-0.16.0 lib/oas_parser/raw_accessor.rb