Class: Octogate::TargetBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/octogate/target_builder.rb

Instance Method Summary collapse

Constructor Details

#initializeTargetBuilder

Returns a new instance of TargetBuilder.



3
4
5
6
7
8
9
10
11
# File 'lib/octogate/target_builder.rb', line 3

def initialize
  @url            = nil
  @username       = nil
  @password       = nil
  @hook_type      = [:push]
  @http_method    = :get
  @parameter_type = :query
  @match          = nil
end

Instance Method Details

#__to_target__Object



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/octogate/target_builder.rb', line 45

def __to_target__
  Target.new(
    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) ⇒ Object



25
26
27
# File 'lib/octogate/target_builder.rb', line 25

def hook_type(types)
  @hook_type = Array(types)
end

#http_method(http_method) ⇒ Object



29
30
31
# File 'lib/octogate/target_builder.rb', line 29

def http_method(http_method)
  @http_method = http_method
end

#match(match_proc) ⇒ Object



37
38
39
# File 'lib/octogate/target_builder.rb', line 37

def match(match_proc)
  @match = match_proc
end

#parameter_type(parameter_type) ⇒ Object



33
34
35
# File 'lib/octogate/target_builder.rb', line 33

def parameter_type(parameter_type)
  @parameter_type = parameter_type
end

#params(params) ⇒ Object



41
42
43
# File 'lib/octogate/target_builder.rb', line 41

def params(params)
  @params = params
end

#password(password) ⇒ Object



21
22
23
# File 'lib/octogate/target_builder.rb', line 21

def password(password)
  @password = password
end

#url(url) ⇒ Object



13
14
15
# File 'lib/octogate/target_builder.rb', line 13

def url(url)
  @url = url
end

#username(username) ⇒ Object



17
18
19
# File 'lib/octogate/target_builder.rb', line 17

def username(username)
  @username = username
end