Sha256: ae2695a1f5193b75e4bfb9e0c55e3458dfe30449162406c855ca8b3343af5d7a

Contents?: true

Size: 883 Bytes

Versions: 8

Compression:

Stored size: 883 Bytes

Contents

class Eco::API::UseCases::DefaultCases::TagTree < Eco::API::Common::Loaders::UseCase
  name "tagtree"
  type :other

  def main(session, options, usecase)
    puts "Use case still in development"
    exit
    options[:end_get] = false
    operations.keys.each do |key|
      process(key)
    end
  end

  def process(key)
    case key
    when :diff
      require_graphql_auth!

    when :show_backend
      require_graphql_auth!

    else
      logger.warn("Operation #{key} not supported")
    end
  end

  private

  def require_graphql_auth!
    unless session.config.api.version_available?(:graphql)
      logger.error("Missing parameters for to configure a GraphQL connexion.")
    end
  end

  def operations
    (options.dig(:tagtree, :operations) || {})
  end

  def graphql
   @graphql ||= session.api(version: :graphql)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eco-helpers-2.5.10 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.9 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.8 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.7 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.6 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.5 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.4 lib/eco/api/usecases/default_cases/tagtree_case.rb
eco-helpers-2.5.3 lib/eco/api/usecases/default_cases/tagtree_case.rb