Class: Contrast::Agent::ModuleData

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/assess/module_data.rb

Overview

A simple wrapper around a Module and a call to its name, used to avoid calling the Module#name method and generating extra Strings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod, mod_name = nil) ⇒ ModuleData

Returns a new instance of ModuleData.



11
12
13
14
# File 'lib/contrast/agent/assess/module_data.rb', line 11

def initialize mod, mod_name = nil
  @mod = mod
  @mod_name = mod_name || mod.cs__name
end

Instance Attribute Details

#modObject (readonly)

Returns the value of attribute mod.



9
10
11
# File 'lib/contrast/agent/assess/module_data.rb', line 9

def mod
  @mod
end

#mod_nameObject (readonly)

Returns the value of attribute mod_name.



9
10
11
# File 'lib/contrast/agent/assess/module_data.rb', line 9

def mod_name
  @mod_name
end