Class: Aikido::Zen::Package

Inherits:
Struct
  • Object
show all
Defined in:
lib/aikido/zen/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, sinks = Aikido::Zen::Sinks.registry) ⇒ Package

Returns a new instance of Package.



7
8
9
10
# File 'lib/aikido/zen/package.rb', line 7

def initialize(name, version, sinks = Aikido::Zen::Sinks.registry)
  super(name, version)
  @sinks = sinks
end

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/aikido/zen/package.rb', line 6

def name
  @name
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



6
7
8
# File 'lib/aikido/zen/package.rb', line 6

def version
  @version
end

Instance Method Details

#as_jsonObject



18
19
20
# File 'lib/aikido/zen/package.rb', line 18

def as_json
  {name => version.to_s}
end

#supported?Boolean

Returns whether we explicitly protect against exploits in this library.

Returns:

  • (Boolean)

    whether we explicitly protect against exploits in this library.



14
15
16
# File 'lib/aikido/zen/package.rb', line 14

def supported?
  @sinks.include?(name)
end