class Highway::Steps::Parameters::Base

This class is a base abstract class for other classes in this module. You should not use it directly.

Attributes

name[R]

Name of the parameter.

@return [String]

Public Class Methods

new() click to toggle source

Initialize an instance.

# File lib/highway/steps/parameters/base.rb, line 17
def initialize()
  raise NotImplementedError.new("You must not call `#{__method__.to_s}` on `#{self.class.to_s}`.")
end

Public Instance Methods

is_required?() click to toggle source

Whether the parameter is required.

@return [Boolean]

# File lib/highway/steps/parameters/base.rb, line 29
def is_required?
  @required
end
typecheck_and_validate(value, interface:, keypath: []) click to toggle source

Typecheck and validate a value of the parameter.

This method returns typechecked, coerced and validated value or raises a fatal error if value has invalid type, can't be coerced or is othweriwse invalid.

@param value [Object] A value. @param interface [Highway::Interface] An interface instance. @param keypath [Array<String>] A keypath to be used for debugging purposes.

@return [Object]

# File lib/highway/steps/parameters/base.rb, line 44
def typecheck_and_validate(value, interface:, keypath: [])
  raise NotImplementedError.new("You must override `#{__method__.to_s}` in `#{self.class.to_s}`.")
end