Class: AbideDevUtils::CEM::Resource
- Inherits:
-
Object
- Object
- AbideDevUtils::CEM::Resource
- Defined in:
- lib/abide_dev_utils/cem/benchmark.rb
Overview
Represents a resource data resource statement
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #cem_options ⇒ Object
- #cem_options? ⇒ Boolean
- #cem_protected ⇒ Object
- #cem_protected? ⇒ Boolean
- #controls ⇒ Object
- #dependent_controls ⇒ Object
- #file_path ⇒ Object
-
#initialize(title, data, framework, mapper) ⇒ Resource
constructor
A new instance of Resource.
- #manifest ⇒ Object
- #manifest? ⇒ Boolean
- #to_reference ⇒ Object
Constructor Details
#initialize(title, data, framework, mapper) ⇒ Resource
Returns a new instance of Resource.
15 16 17 18 19 20 21 22 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 15 def initialize(title, data, framework, mapper) @title = title @data = data @type = data['type'] @framework = framework @mapper = mapper @dependent = [] end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
13 14 15 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 13 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 13 def type @type end |
Instance Method Details
#cem_options ⇒ Object
44 45 46 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 44 def @cem_options ||= resource_properties('cem_options') end |
#cem_options? ⇒ Boolean
40 41 42 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 40 def !.empty? end |
#cem_protected ⇒ Object
52 53 54 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 52 def cem_protected @cem_protected ||= resource_properties('cem_protected') end |
#cem_protected? ⇒ Boolean
48 49 50 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 48 def cem_protected? !cem_protected.empty? end |
#controls ⇒ Object
36 37 38 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 36 def controls @controls || load_controls end |
#dependent_controls ⇒ Object
56 57 58 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 56 def dependent_controls @dependent_controls ||= @dependent.flatten.uniq.filter_map { |x| controls.find { |y| y.id == x } } end |
#file_path ⇒ Object
32 33 34 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 32 def file_path @file_path ||= AbideDevUtils::Ppt::ClassUtils.path_from_class_name((type == 'class' ? title : type)) end |
#manifest ⇒ Object
24 25 26 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 24 def manifest @manifest ||= load_manifest end |
#manifest? ⇒ Boolean
28 29 30 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 28 def manifest? !manifest.nil? end |
#to_reference ⇒ Object
60 61 62 |
# File 'lib/abide_dev_utils/cem/benchmark.rb', line 60 def to_reference "#{type.split('::').map(&:capitalize).join('::')}['#{title}']" end |