lib/eco/api/session_config/use_cases.rb in eco-helpers-0.6.0 vs lib/eco/api/session_config/use_cases.rb in eco-helpers-0.6.1
- old
+ new
@@ -1,21 +1,22 @@
module Eco
module API
class SessionConfig
class UseCases < Hash
-
+ attr_reader :config
+
def initialize(root:)
super(nil)
- @root = root
+ @root = root
+ @config = @root
end
# CUSTOM USE CASES
def add
- self["use_group"] ||= Eco::API::UseCases::UseGroup.new
new_group = Eco::API::UseCases::UseGroup.new
+ yield(new_group, config)
- yield(new_group, self)
-
+ self["use_group"] ||= Eco::API::UseCases::UseGroup.new
group = self["use_group"]
group = group ? group.merge(new_group) : group
self["use_group"] = group
end