Class: HackerOne::Client::StructuredScope

Inherits:
Object
  • Object
show all
Includes:
ResourceHelper
Defined in:
lib/hackerone/client/structured_scope.rb

Constant Summary collapse

DELEGATES =
[
  :asset_identifier,
  :asset_type,
  :availability_requirement,
  :confidentiality_requirement,
  :eligible_for_bounty,
  :eligible_for_submission,
  :instruction,
  :integrity_requirement,
  :max_severity,
  :reference
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ResourceHelper

included, #make_get_request, #make_post_request, #make_put_request, #parse_response

Constructor Details

#initialize(scope, program = nil) ⇒ StructuredScope

Returns a new instance of StructuredScope.



25
26
27
28
# File 'lib/hackerone/client/structured_scope.rb', line 25

def initialize(scope, program = nil)
  @program = program
  @scope = scope
end

Instance Attribute Details

#programObject (readonly)

Returns the value of attribute program.



23
24
25
# File 'lib/hackerone/client/structured_scope.rb', line 23

def program
  @program
end

Instance Method Details

#idObject



30
31
32
# File 'lib/hackerone/client/structured_scope.rb', line 30

def id
  @scope[:id]
end

#update(attributes:) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/hackerone/client/structured_scope.rb', line 34

def update(attributes:)
  body = {
    type: "structured-scope",
    attributes: attributes
  }
  make_put_request("programs/#{program.id}/structured_scopes/#{id}", request_body: body)
end