Sha256: 7d225dcd17168d5410261d0becc440cbf3a23112f620b53744fb9d70998daddd
Contents?: true
Size: 501 Bytes
Versions: 20
Compression:
Stored size: 501 Bytes
Contents
require_relative "./util" require "snake_camel/methods" module Swagger class Schema module SchemaAccessor private def define_schema_accessor(*camel_names) camel_names.flatten.each do |name| define_method(name) { Util.try_hash(@schema, name) } alias_case name end end def alias_case(camel) snake = SnakeCamel::Methods.snakecase(camel.to_s) alias_method snake, camel unless snake == camel end end end end
Version data entries
20 entries across 20 versions & 1 rubygems