Class: HackerOne::Client::Asset
- Inherits:
-
Object
- Object
- HackerOne::Client::Asset
- Includes:
- ResourceHelper
- Defined in:
- lib/hackerone/client/asset.rb
Constant Summary collapse
- DELEGATES =
[ :asset_type, :identifier, :description, :coverage, :max_severity, :confidentiality_requirement, :integrity_requirement, :availability_requirement, :created_at, :updated_at, :archived_at, :reference, :state, ]
Instance Attribute Summary collapse
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(asset, organization) ⇒ Asset
constructor
A new instance of Asset.
- #programs ⇒ Object
- #update(attributes:) ⇒ Object
Methods included from ResourceHelper
included, #make_get_request, #make_post_request, #make_put_request, #parse_response
Constructor Details
#initialize(asset, organization) ⇒ Asset
Returns a new instance of Asset.
28 29 30 31 |
# File 'lib/hackerone/client/asset.rb', line 28 def initialize(asset, organization) @asset = asset @organization = organization end |
Instance Attribute Details
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
26 27 28 |
# File 'lib/hackerone/client/asset.rb', line 26 def organization @organization end |
Instance Method Details
#id ⇒ Object
33 34 35 |
# File 'lib/hackerone/client/asset.rb', line 33 def id @asset[:id] end |
#programs ⇒ Object
45 46 47 |
# File 'lib/hackerone/client/asset.rb', line 45 def programs relationships.programs[:data].map { |p| Program.new(p) } end |
#update(attributes:) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/hackerone/client/asset.rb', line 37 def update(attributes:) body = { type: "asset", attributes: attributes } make_put_request("organizations/#{organization.id}/assets/#{id}", request_body: body) end |