Class: Manifold::API::Vector

Inherits:
Object
  • Object
show all
Defined in:
lib/manifold/api/vector.rb

Overview

Describes the entities for whom metrics are calculated.

Constant Summary collapse

DEFAULT_TEMPLATE_PATH =
File.expand_path(
  "../templates/vector_template.yml", __dir__
).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/manifold/api/vector.rb', line 7

def name
  @name
end

#template_pathObject (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

#addObject



18
19
20
21
# File 'lib/manifold/api/vector.rb', line 18

def add
  directory.mkpath
  FileUtils.cp(template_path, config_path)
end