class TLAW::DSL::BaseWrapper

@private

Public Class Methods

new(object) click to toggle source
# File lib/tlaw/dsl.rb, line 405
def initialize(object)
  @object = object
end

Public Instance Methods

define(&block) click to toggle source
# File lib/tlaw/dsl.rb, line 409
def define(&block)
  instance_eval(&block)
end
desc(text)
Alias for: description
description(text) click to toggle source
# File lib/tlaw/dsl.rb, line 413
def description(text)
  # first, remove spaces at a beginning of each line
  # then, remove empty lines before and after docs block
  @object.description =
    text
    .gsub(/^[ \t]+/, '')
    .gsub(/\A\n|\n\s*\Z/, '')
end
Also aliased as: desc
docs(link) click to toggle source
# File lib/tlaw/dsl.rb, line 424
def docs(link)
  @object.docs_link = link
end
param(name, type = nil, **opts) click to toggle source
# File lib/tlaw/dsl.rb, line 428
def param(name, type = nil, **opts)
  @object.param_set.add(name, **opts.merge(type: type))
end
post_process(key = nil, &block) click to toggle source
# File lib/tlaw/dsl.rb, line 432
def post_process(key = nil, &block)
  @object.response_processor.add_post_processor(key, &block)
end
post_process_items(key, &block) click to toggle source
# File lib/tlaw/dsl.rb, line 451
def post_process_items(key, &block)
  PostProcessProxy
    .new(key, @object.response_processor)
    .instance_eval(&block)
end
post_process_replace(&block) click to toggle source
# File lib/tlaw/dsl.rb, line 436
def post_process_replace(&block)
  @object.response_processor.add_replacer(&block)
end