Class: WrkFlo

Inherits:
Object
  • Object
show all
Defined in:
lib/wrkflo/wrkflo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 options
  @profile = YAML.load(File.open(options[:profile]))
  @profile_source = options[:profile]
  @direction = options[:backward] ? :backward : :forward
end

Instance Attribute Details

#directionObject

Returns the value of attribute direction.



4
5
6
# File 'lib/wrkflo/wrkflo.rb', line 4

def direction
  @direction
end

#profileObject

Returns the value of attribute profile.



4
5
6
# File 'lib/wrkflo/wrkflo.rb', line 4

def profile
  @profile
end

#profile_sourceObject

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