class R2OAS::Base

Public Class Methods

new(options = {}) click to toggle source
# File lib/r2-oas/base.rb, line 5
def initialize(options = {})
  @options = options

  (AppConfiguration::VALID_OPTIONS_KEYS + options.keys).each do |key|
    send("#{key}=", merged_options[key])
  end
end

Private Instance Methods

doc_save_file_path() click to toggle source
# File lib/r2-oas/base.rb, line 33
def doc_save_file_path
  File.expand_path("#{root_dir_path}/#{doc_save_file_name}")
end
logger() click to toggle source
# File lib/r2-oas/base.rb, line 25
def logger
  R2OAS.logger
end
merged_options() click to toggle source
# File lib/r2-oas/base.rb, line 17
def merged_options
  if @options.present?
    R2OAS.options.merge(@options)
  else
    R2OAS.options
  end
end
ns_div() click to toggle source
# File lib/r2-oas/base.rb, line 37
def ns_div
  case namespace_type
  when :dot
    '.'
  when :underbar
    '_'
  else
    raise "Do not support #{namespace_type}"
  end
end
schema_save_dir_path() click to toggle source
# File lib/r2-oas/base.rb, line 29
def schema_save_dir_path
  File.expand_path("#{root_dir_path}/#{schema_save_dir_name}")
end