Sha256: d31e148eafc67dc46e7dcdaf4211a9ad4da865cc68fe7f375b01c1440f56451c

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

module Eco
  module API
    class SessionConfig
      class UseCases < Hash

        def initialize(root:)
          super(nil)
          @root = 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, self)

          group = self["use_group"]
          group = group ? group.merge(new_group) : group
          self["use_group"] = group
        end

        def use_group
          self["use_group"]
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eco-helpers-0.6.0 lib/eco/api/session_config/use_cases.rb