Class: SwaggerHubApiPusher::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_hub_api_pusher/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

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_nameObject

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

#ownerObject

Returns the value of attribute owner.



3
4
5
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 3

def owner
  @owner
end

#swagger_fileObject

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

#versionObject

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_messagesObject



15
16
17
# File 'lib/swagger_hub_api_pusher/configuration.rb', line 15

def errors_messages
  errors.map { |k, v| "#{k} #{v}" }.join(', ')
end

#valid?Boolean

Returns:

  • (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