class HaveAPI::GoClient::Parameters::Base

Attributes

desc[R]

@return [Hash]

go_in_type[R]

Go type for action input @return [String]

go_name[R]

Parameter name in Go @return [String]

go_out_type[R]

Go type for action output @return [String]

io[R]

@return [InputOutput]

name[R]

Parameter name in the API @return [String]

type[R]

HaveAPI data type @return [String]

Public Class Methods

handle(&block) click to toggle source

Register the parameter handler

The block is called whenever a new parameter is to be instantiated. If this class supports the parameter, the block returns true, else false. The first class to return true is used.

@yieldparam role [Symbol] @yieldparam direction [Symbol] @yieldparam name [String] @yieldparam desc [Hash] @yiledreturn [Boolean, nil]

# File lib/haveapi/go_client/parameters/base.rb, line 18
def self.handle(&block)
  Parameter.register(self, block)
end
new(io, name, desc) click to toggle source
# File lib/haveapi/go_client/parameters/base.rb, line 45
def initialize(io, name, desc)
  @io = io
  @name = name
  @type = desc[:type]
  @desc = desc
  @go_name = camelize(name)
end

Public Instance Methods

resolve() click to toggle source
# File lib/haveapi/go_client/parameters/base.rb, line 53
def resolve
  do_resolve
  @desc = nil
end

Protected Instance Methods

do_resolve() click to toggle source
# File lib/haveapi/go_client/parameters/base.rb, line 62
def do_resolve

end