class Seahorse::Model::Api

Attributes

endpoint_operation[RW]

@return [Symbol|nil]

metadata[RW]

@return [Hash]

require_endpoint_discovery[RW]

@return [Boolean|nil]

version[RW]

@return [String, nil]

Public Class Methods

new() click to toggle source
# File lib/seahorse/model/api.rb, line 7
def initialize
  @metadata = {}
  @operations = {}
  @authorizers = {}
  @endpoint_operation = nil
  @require_endpoint_discovery = false
end

Public Instance Methods

add_authorizer(name, authorizer) click to toggle source
# File lib/seahorse/model/api.rb, line 75
def add_authorizer(name, authorizer)
  @authorizers[name.to_sym] = authorizer
end
add_operation(name, operation) click to toggle source
# File lib/seahorse/model/api.rb, line 51
def add_operation(name, operation)
  @operations[name.to_sym] = operation
end
async_operation_names() click to toggle source
# File lib/seahorse/model/api.rb, line 47
def async_operation_names
  @operations.select {|_, op| op.async }.keys
end
authorizer(name) click to toggle source
# File lib/seahorse/model/api.rb, line 63
def authorizer(name)
  if @authorizers.key?(name.to_sym)
    @authorizers[name.to_sym]
  else
    raise ArgumentError, "unknown authorizer #{name.inspect}"
  end
end
authorizer_names() click to toggle source
# File lib/seahorse/model/api.rb, line 71
def authorizer_names
  @authorizers.keys
end
authorizers(&block) click to toggle source
# File lib/seahorse/model/api.rb, line 55
def authorizers(&block)
  if block_given?
    @authorizers.each(&block)
  else
    @authorizers.enum_for(:each)
  end
end
inspect(*args) click to toggle source
# File lib/seahorse/model/api.rb, line 79
def inspect(*args)
  "#<#{self.class.name}>"
end
operation(name) click to toggle source
# File lib/seahorse/model/api.rb, line 35
def operation(name)
  if @operations.key?(name.to_sym)
    @operations[name.to_sym]
  else
    raise ArgumentError, "unknown operation #{name.inspect}"
  end
end
operation_names() click to toggle source
# File lib/seahorse/model/api.rb, line 43
def operation_names
  @operations.keys
end
operations(&block) click to toggle source
# File lib/seahorse/model/api.rb, line 27
def operations(&block)
  if block_given?
    @operations.each(&block)
  else
    @operations.enum_for(:each)
  end
end