class Fushin::Models::Attachment
Attributes
url[R]
Public Class Methods
new(url)
click to toggle source
# File lib/fushin/models/attachment.rb, line 7 def initialize(url) @url = url end
Public Instance Methods
ha_link()
click to toggle source
# File lib/fushin/models/attachment.rb, line 22 def ha_link "https://www.hybrid-analysis.com/sample/#{sha256}/" end
sha256()
click to toggle source
# File lib/fushin/models/attachment.rb, line 11 def sha256 @sha256 ||= [].tap do |out| res = HybridAnalysis.quick_url_scan(url) out << res.dig("sha256") end.first end
title()
click to toggle source
# File lib/fushin/models/attachment.rb, line 18 def title "HA: #{sha256}" end
to_attachements()
click to toggle source
# File lib/fushin/models/attachment.rb, line 26 def to_attachements [ { fallback: "HA link", title: title, title_link: ha_link, footer: "hybrid-analysis.com", footer_icon: "http://www.google.com/s2/favicons?domain=hybrid-analysis.com" } ] end