Class: Automux::Core::Blueprint

Inherits:
Base
  • Object
show all
Defined in:
lib/automux/core/blueprint.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Support::CustomAccessors

#dup_attr_reader

Constructor Details

#initialize(path) ⇒ Blueprint

Returns a new instance of Blueprint.



6
7
8
9
# File 'lib/automux/core/blueprint.rb', line 6

def initialize(path)
  @name = File.basename(path, '.yml')
  @path = path
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/automux/core/blueprint.rb', line 4

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/automux/core/blueprint.rb', line 4

def path
  @path
end

#source_blueprintObject (readonly)

Returns the value of attribute source_blueprint.



4
5
6
# File 'lib/automux/core/blueprint.rb', line 4

def source_blueprint
  @source_blueprint
end

Class Method Details

.build_by_name(name) ⇒ Object



24
25
26
27
# File 'lib/automux/core/blueprint.rb', line 24

def build_by_name(name)
  path = File.join(Automux::Paths.blueprints_container, "#{ name }.yml")
  new(path)
end

Instance Method Details

#get_bindingObject



15
16
17
# File 'lib/automux/core/blueprint.rb', line 15

def get_binding
  binding
end

#readObject



11
12
13
# File 'lib/automux/core/blueprint.rb', line 11

def read
  Automux::Library::YamlParser.load_file(path)
end

#source=(blueprint) ⇒ Object



19
20
21
# File 'lib/automux/core/blueprint.rb', line 19

def source=(blueprint)
  @source_blueprint = blueprint
end