Sha256: 958b10cb450364c725ce84b4ddd371716a64f38112d8dcccb6a5f5c472265d0a

Contents?: true

Size: 1.47 KB

Versions: 21

Compression:

Stored size: 1.47 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require_relative 'base_action'

module GoodData
  module LCM2
    class PrintActions < BaseAction
      DESCRIPTION = 'Print Information About Actions'

      PARAMS = {
      }

      class << self
        def call(params)
          results = []

          actions = GoodData::LCM2::BaseAction.descendants

          actions.each do |action|
            action_params = action.const_get(:PARAMS)
            action_params_keys = action_params.keys
            params = action_params_keys.map do |param|
              param
            end

            types = action_params.map do |_k, param|
              param[:type].class.short_name
            end

            required = action_params.map do |_k, param|
              param[:opts][:required]
            end

            defaults = action_params.map do |_k, param|
              param[:opts][:default]
            end

            results << {
              name: action.short_name,
              description: action.const_get(:DESCRIPTION),
              params: params.join("\n"),
              types: types.join("\n"),
              required: required.join("\n"),
              default: defaults.join("\n")
            }
          end

          # Return results
          results
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
gooddata-1.3.2-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.3.2 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.3.1-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.3.1 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.3.0-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.3.0 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.2.1-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.2.1 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.2.0-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.2.0 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.1.0-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.1.0 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.2-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.2 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.1 lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.1-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.0-java lib/gooddata/lcm/actions/print_actions.rb
gooddata-1.0.0 lib/gooddata/lcm/actions/print_actions.rb
gooddata-0.6.54 lib/gooddata/lcm/actions/print_actions.rb
gooddata-0.6.53 lib/gooddata/lcm/actions/print_actions.rb