class Octogate::TargetBuilder

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
# File lib/octogate/target_builder.rb, line 5
def initialize(name)
  @name           = name
  @url            = nil
  @username       = nil
  @password       = nil
  @hook_type      = [:push]
  @http_method    = :get
  @parameter_type = :query
  @match          = nil
end

Public Instance Methods

__to_target__() click to toggle source
# File lib/octogate/target_builder.rb, line 48
def __to_target__
  Target.new(
    name:            @name,
    url:             @url,
    username:        @username,
    password:        @password,
    hook_type:       @hook_type,
    http_method:     @http_method,
    parameter_type:  @parameter_type,
    params:          @params,
    match:           @match,
  )
end
hook_type(types) click to toggle source
# File lib/octogate/target_builder.rb, line 28
def hook_type(types)
  @hook_type = Array(types)
end
http_method(http_method) click to toggle source
# File lib/octogate/target_builder.rb, line 32
def http_method(http_method)
  @http_method = http_method
end
match(match_proc) click to toggle source
# File lib/octogate/target_builder.rb, line 40
def match(match_proc)
  @match = match_proc
end
parameter_type(parameter_type) click to toggle source
# File lib/octogate/target_builder.rb, line 36
def parameter_type(parameter_type)
  @parameter_type = parameter_type
end
params(params) click to toggle source
# File lib/octogate/target_builder.rb, line 44
def params(params)
  @params = params
end
password(password) click to toggle source
# File lib/octogate/target_builder.rb, line 24
def password(password)
  @password = password
end
url(url) click to toggle source
# File lib/octogate/target_builder.rb, line 16
def url(url)
  @url = url
end
username(username) click to toggle source
# File lib/octogate/target_builder.rb, line 20
def username(username)
  @username = username
end