Class: RVGP::Base::Command::PlotTarget
- Defined in:
- lib/rvgp/base/command.rb
Overview
This is an implementation of Target, that matches Plots.
This class allows any of the current project’s plots, to match a target, based on their name and variants.
Any class that operates by way of a plot-defined target, can use this implementation, in lieu of re-implementing the wheel.
Instance Attribute Summary collapse
-
#plot ⇒ RVGP::Plot
readonly
An instance of the plot that offers our :name variant.
Attributes inherited from Target
Class Method Summary collapse
-
.all ⇒ Array<RVGP::Base::Command::PlotTarget>
All possible Plot Targets that the project has defined.
Instance Method Summary collapse
-
#initialize(name, plot) ⇒ PlotTarget
constructor
Create a new PlotTarget.
Methods inherited from Target
Constructor Details
#initialize(name, plot) ⇒ PlotTarget
Create a new PlotTarget
140 141 142 143 |
# File 'lib/rvgp/base/command.rb', line 140 def initialize(name, plot) super name, name @plot = plot end |
Instance Attribute Details
#plot ⇒ RVGP::Plot (readonly)
An instance of the plot that offers our :name variant
134 135 136 |
# File 'lib/rvgp/base/command.rb', line 134 def plot @plot end |
Class Method Details
.all ⇒ Array<RVGP::Base::Command::PlotTarget>
All possible Plot Targets that the project has defined.
160 161 162 163 164 |
# File 'lib/rvgp/base/command.rb', line 160 def self.all RVGP::Plot.all(RVGP.app.config.project_path('app/plots')).map do |plot| plot.variants.map { |params| new params[:name], plot } end.flatten end |