Class: Rpdoc::Configuration
- Inherits:
-
Object
- Object
- Rpdoc::Configuration
- Defined in:
- lib/rpdoc/configuration.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
Returns the value of attribute collection_name.
-
#collection_schema ⇒ Object
readonly
Returns the value of attribute collection_schema.
-
#collection_uid ⇒ Object
Returns the value of attribute collection_uid.
-
#collection_workspace ⇒ Object
Returns the value of attribute collection_workspace.
-
#postman_apikey ⇒ Object
Returns the value of attribute postman_apikey.
-
#postman_collection_path ⇒ Object
readonly
Returns the value of attribute postman_collection_path.
-
#postman_host ⇒ Object
readonly
Returns the value of attribute postman_host.
-
#rpdoc_auto_push ⇒ Object
Returns the value of attribute rpdoc_auto_push.
-
#rpdoc_auto_push_strategy ⇒ Object
Returns the value of attribute rpdoc_auto_push_strategy.
-
#rpdoc_collection_filename ⇒ Object
Returns the value of attribute rpdoc_collection_filename.
-
#rpdoc_description_filename ⇒ Object
Returns the value of attribute rpdoc_description_filename.
-
#rpdoc_enable ⇒ Object
Returns the value of attribute rpdoc_enable.
-
#rpdoc_request_filename ⇒ Object
Returns the value of attribute rpdoc_request_filename.
-
#rpdoc_root ⇒ Object
Returns the value of attribute rpdoc_root.
-
#rspec_request_allow_headers ⇒ Object
Returns the value of attribute rspec_request_allow_headers.
-
#rspec_server_host ⇒ Object
Returns the value of attribute rspec_server_host.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# 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 |
Instance Attribute Details
#collection_name ⇒ Object
Returns the value of attribute collection_name.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def collection_name @collection_name end |
#collection_schema ⇒ Object (readonly)
Returns the value of attribute collection_schema.
5 6 7 |
# File 'lib/rpdoc/configuration.rb', line 5 def collection_schema @collection_schema end |
#collection_uid ⇒ Object
Returns the value of attribute collection_uid.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def collection_uid @collection_uid end |
#collection_workspace ⇒ Object
Returns the value of attribute collection_workspace.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def collection_workspace @collection_workspace end |
#postman_apikey ⇒ Object
Returns the value of attribute postman_apikey.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def postman_apikey @postman_apikey end |
#postman_collection_path ⇒ Object (readonly)
Returns the value of attribute postman_collection_path.
5 6 7 |
# File 'lib/rpdoc/configuration.rb', line 5 def postman_collection_path @postman_collection_path end |
#postman_host ⇒ Object (readonly)
Returns the value of attribute postman_host.
5 6 7 |
# File 'lib/rpdoc/configuration.rb', line 5 def postman_host @postman_host end |
#rpdoc_auto_push ⇒ Object
Returns the value of attribute rpdoc_auto_push.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_auto_push @rpdoc_auto_push end |
#rpdoc_auto_push_strategy ⇒ Object
Returns the value of attribute rpdoc_auto_push_strategy.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_auto_push_strategy @rpdoc_auto_push_strategy end |
#rpdoc_collection_filename ⇒ Object
Returns the value of attribute rpdoc_collection_filename.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_collection_filename @rpdoc_collection_filename end |
#rpdoc_description_filename ⇒ Object
Returns the value of attribute rpdoc_description_filename.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_description_filename @rpdoc_description_filename end |
#rpdoc_enable ⇒ Object
Returns the value of attribute rpdoc_enable.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_enable @rpdoc_enable end |
#rpdoc_request_filename ⇒ Object
Returns the value of attribute rpdoc_request_filename.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_request_filename @rpdoc_request_filename end |
#rpdoc_root ⇒ Object
Returns the value of attribute rpdoc_root.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rpdoc_root @rpdoc_root end |
#rspec_request_allow_headers ⇒ Object
Returns the value of attribute rspec_request_allow_headers.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rspec_request_allow_headers @rspec_request_allow_headers end |
#rspec_server_host ⇒ Object
Returns the value of attribute rspec_server_host.
10 11 12 |
# File 'lib/rpdoc/configuration.rb', line 10 def rspec_server_host @rspec_server_host end |
Instance Method Details
#valid? ⇒ Boolean
48 49 50 51 52 53 |
# 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 |