Class: Manifold::API::Vector
- Inherits:
-
Object
- Object
- Manifold::API::Vector
- Defined in:
- lib/manifold/api/vector.rb
Overview
Describes the entities for whom metrics are calculated.
Constant Summary collapse
- DEFAULT_TEMPLATE_PATH =
File.( "../templates/vector_template.yml", __dir__ ).freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#template_path ⇒ Object
readonly
Returns the value of attribute template_path.
Instance Method Summary collapse
- #add ⇒ Object
-
#initialize(name, template_path: DEFAULT_TEMPLATE_PATH) ⇒ Vector
constructor
A new instance of Vector.
Constructor Details
#initialize(name, template_path: DEFAULT_TEMPLATE_PATH) ⇒ Vector
Returns a new instance of Vector.
13 14 15 16 |
# File 'lib/manifold/api/vector.rb', line 13 def initialize(name, template_path: DEFAULT_TEMPLATE_PATH) @name = name @template_path = Pathname(template_path) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/manifold/api/vector.rb', line 7 def name @name end |
#template_path ⇒ Object (readonly)
Returns the value of attribute template_path.
7 8 9 |
# File 'lib/manifold/api/vector.rb', line 7 def template_path @template_path end |
Instance Method Details
#add ⇒ Object
18 19 20 21 |
# File 'lib/manifold/api/vector.rb', line 18 def add directory.mkpath FileUtils.cp(template_path, config_path) end |