Class: WrkFlo
- Inherits:
-
Object
- Object
- WrkFlo
- Defined in:
- lib/wrkflo/wrkflo.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#profile_source ⇒ Object
Returns the value of attribute profile_source.
Instance Method Summary collapse
-
#[](project) ⇒ Object
Get a specific project out of the profile.
-
#initialize(options) ⇒ WrkFlo
constructor
A new instance of WrkFlo.
Constructor Details
#initialize(options) ⇒ WrkFlo
Returns a new instance of WrkFlo.
6 7 8 9 10 |
# File 'lib/wrkflo/wrkflo.rb', line 6 def initialize @profile = YAML.load(File.open([:profile])) @profile_source = [:profile] @direction = [:backward] ? :backward : :forward end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
4 5 6 |
# File 'lib/wrkflo/wrkflo.rb', line 4 def direction @direction end |
#profile ⇒ Object
Returns the value of attribute profile.
4 5 6 |
# File 'lib/wrkflo/wrkflo.rb', line 4 def profile @profile end |
#profile_source ⇒ Object
Returns the value of attribute profile_source.
4 5 6 |
# File 'lib/wrkflo/wrkflo.rb', line 4 def profile_source @profile_source end |
Instance Method Details
#[](project) ⇒ Object
Get a specific project out of the profile. If the profile does not define the given project, return nil.
14 15 16 17 18 |
# File 'lib/wrkflo/wrkflo.rb', line 14 def [] project if @profile.has_key?(project) Project.new(project, @profile[project]) end end |