Class: CopyleaksApi::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks_api/config.rb

Constant Summary collapse

DEFAULTS =
{
  sandbox_mode: false,
  allow_partial_scan: false,
  http_callback: nil,
  email_callback: nil,
  custom_fields: {},
}.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.allow_partial_scan=(value) ⇒ Object (writeonly)

Sets the attribute allow_partial_scan

Parameters:

  • value

    the value to set the attribute allow_partial_scan to.



12
13
14
# File 'lib/copyleaks_api/config.rb', line 12

def allow_partial_scan=(value)
  @allow_partial_scan = value
end

.custom_fields=(value) ⇒ Object (writeonly)

Sets the attribute custom_fields

Parameters:

  • value

    the value to set the attribute custom_fields to.



12
13
14
# File 'lib/copyleaks_api/config.rb', line 12

def custom_fields=(value)
  @custom_fields = value
end

.email_callback=(value) ⇒ Object (writeonly)

Sets the attribute email_callback

Parameters:

  • value

    the value to set the attribute email_callback to.



12
13
14
# File 'lib/copyleaks_api/config.rb', line 12

def email_callback=(value)
  @email_callback = value
end

.http_callback=(value) ⇒ Object (writeonly)

Sets the attribute http_callback

Parameters:

  • value

    the value to set the attribute http_callback to.



12
13
14
# File 'lib/copyleaks_api/config.rb', line 12

def http_callback=(value)
  @http_callback = value
end

.sandbox_mode=(value) ⇒ Object (writeonly)

Sets the attribute sandbox_mode

Parameters:

  • value

    the value to set the attribute sandbox_mode to.



12
13
14
# File 'lib/copyleaks_api/config.rb', line 12

def sandbox_mode=(value)
  @sandbox_mode = value
end

Class Method Details

.config {|_self| ... } ⇒ Object

provide block syntax possibility for setting options

Yields:

  • (_self)

Yield Parameters:



24
25
26
# File 'lib/copyleaks_api/config.rb', line 24

def config
  yield(self)
end

.resetObject

reset all options to default



29
30
31
# File 'lib/copyleaks_api/config.rb', line 29

def reset
  DEFAULTS.each { |attr, value| instance_variable_set("@#{attr}", value) }
end