class Rpdoc::Configuration

Attributes

collection_name[RW]
collection_schema[R]
collection_uid[RW]
collection_workspace[RW]
postman_apikey[RW]
postman_collection_path[R]
postman_host[R]
rpdoc_auto_push[RW]
rpdoc_auto_push_strategy[RW]
rpdoc_collection_filename[RW]
rpdoc_description_filename[RW]
rpdoc_enable[RW]
rpdoc_request_filename[RW]
rpdoc_root[RW]
rspec_request_allow_headers[RW]
rspec_server_host[RW]

Public Class Methods

new() click to toggle source
# File lib/rpdoc/configuration.rb, line 25
def initialize
  @rpdoc_enable = ENV['RPDOC_ENABLE'] != 'false'

  @postman_host = 'https://api.getpostman.com'
  @postman_collection_path = "/collections"
  @postman_apikey = nil

  @collection_workspace = nil
  @collection_uid = nil
  @collection_name = 'Rpdoc'
  @collection_schema = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'

  @rspec_server_host = '{{server_host}}'
  @rspec_request_allow_headers = ['User-Agent', 'Content-Type', 'Authorization']

  @rpdoc_root = 'rpdoc'
  @rpdoc_request_filename = 'request.json'
  @rpdoc_description_filename = 'description.md'
  @rpdoc_collection_filename = 'collection.json'
  @rpdoc_auto_push = false
  @rpdoc_auto_push_strategy = :push_and_create # or :push_and_update
end

Public Instance Methods

valid?() click to toggle source
# File lib/rpdoc/configuration.rb, line 48
def valid?
  return true unless @rpdoc_enable && @rpdoc_auto_push
  return false if @postman_apikey.nil?
  return false if @rpdoc_auto_push_strategy == :push_and_update && @collection_uid.nil?
  true
end