builder/extra/cluster-home/lib/ruby/tungsten/api.rb
def list (display_mode=:text)
        if display_mode == :text
            puts header()
            puts dashes()
            @api_calls.sort.each do |name,api|
                puts api
            end
        else
            if display_mode == :hash
                pp self.to_hash
            elsif display_mode == :json
                puts JSON.generate(self.to_hash)
            else
                raise SyntaxError,  "no suitable display method selected"
            end
        end
    end
#
# Display the list of registered API calls
# using a given display_mode: 
# * :text (default)
# * :hash : good for further usage of the API call within the same application
# * :json : good to export to other applications
#
# Safe to use in derived classes 
#


Safe to use in derived classes
Safe to use in derived classes
def list (display_mode=:text)
        if display_mode == :text
            puts header()
            puts dashes()
            @api_calls.sort.each do |name,api|
                puts api
            end
        else
            if display_mode == :hash
                pp self.to_hash
            elsif display_mode == :json
                puts JSON.generate(self.to_hash)
            else
                raise SyntaxError,  "no suitable display method selected"
            end
        end
    end
def list ( display_mode = :text ) if display_mode == :text puts header ( ) puts dashes ( ) @api_calls . sort . each do | name , api | puts api end else if display_mode == :hash pp self . to_hash elsif display_mode == :json puts JSON . generate ( self . to_hash ) else raise SyntaxError , "no suitable display method selected" end end end
Display the list of registered API calls
using a given display_mode:
 :text (default)
 :hash : good for further usage of the API call within the same application
 :json : good to export to other applications
Display the list of registered API calls using a given display_mode : : text ( default ) : hash : good for further usage of the API call within the same application : json : good to export to other applications
display_mode