Sha256: b0ef47d703b0cbdf874292ce85a6a5fba72b530f0baaa648e187358e9d12eedd

Contents?: true

Size: 987 Bytes

Versions: 7

Compression:

Stored size: 987 Bytes

Contents

module Eco
  module API
    class Session
      class Config
        class Apis
          module SpaceHelpers
            def space_option?
              SCR.get_arg('-space')
            end

            def space_option
              :default.then do |default|
                value = SCR.get_arg('-space', with_param: true)

                value = nil             if value.to_s.strip.empty?
                value = to_space(value) unless value.nil?
                next default unless value

                value
              end
            end

            def set_options_space!(space)
              ASSETS.cli.options.deep_merge!(api: {space: space})
            end

            private

            def to_space(...)
              Session::Config::Api.to_space(...)
            end

            def full_name(...)
              Session::Config::Api.full_name(...)
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eco-helpers-3.0.21 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.20 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.19 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.18 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.17 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.16 lib/eco/api/session/config/apis/space_helpers.rb
eco-helpers-3.0.15 lib/eco/api/session/config/apis/space_helpers.rb