Class: SwaggerHubApiPusher::Configuration
- Inherits:
-
Object
- Object
- SwaggerHubApiPusher::Configuration
- Defined in:
- lib/swagger_hub_api_pusher/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_name ⇒ Object
Returns the value of attribute api_name.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#swagger_file ⇒ Object
Returns the value of attribute swagger_file.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3 def api_key @api_key end |
#api_name ⇒ Object
Returns the value of attribute api_name.
3 4 5 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3 def api_name @api_name end |
#owner ⇒ Object
Returns the value of attribute owner.
3 4 5 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3 def owner @owner end |
#swagger_file ⇒ Object
Returns the value of attribute swagger_file.
3 4 5 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3 def swagger_file @swagger_file end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3 def version @version end |
Instance Method Details
#errors_messages ⇒ Object
15 16 17 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 15 def errors.map { |k, v| "#{k} #{v}" }.join(', ') end |
#valid? ⇒ Boolean
5 6 7 8 9 10 11 12 13 |
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 5 def valid? [:owner, :api_name, :api_key, :version, :swagger_file].each do |param| errors[param] = 'is blank' if is_blank?(public_send(param)) end errors[:swagger_file] = 'not found' if !is_blank?(swagger_file) && file_not_found? errors.empty? end |