Class: JFlow::Activity::Map
- Inherits:
-
Object
- Object
- JFlow::Activity::Map
- Defined in:
- lib/jflow/activity/map.rb
Instance Method Summary collapse
- #add_activity(name, version, klass, options) ⇒ Object
-
#initialize ⇒ Map
constructor
A new instance of Map.
- #klass_for(name, version) ⇒ Object
- #options_for(name, version) ⇒ Object
Constructor Details
#initialize ⇒ Map
Returns a new instance of Map.
4 5 6 |
# File 'lib/jflow/activity/map.rb', line 4 def initialize @map = {} end |
Instance Method Details
#add_activity(name, version, klass, options) ⇒ Object
8 9 10 11 12 |
# File 'lib/jflow/activity/map.rb', line 8 def add_activity(name, version, klass, ) @map ||= {} @map[name] ||= {} @map[name][version] = {:class => klass, :options => } end |
#klass_for(name, version) ⇒ Object
14 15 16 17 |
# File 'lib/jflow/activity/map.rb', line 14 def klass_for(name, version) return nil if !@map.has_key?(name) || !@map[name][version] @map[name][version][:class] end |
#options_for(name, version) ⇒ Object
19 20 21 22 |
# File 'lib/jflow/activity/map.rb', line 19 def (name, version) return nil if !@map.has_key?(name) || !@map[name][version] @map[name][version][:options] end |