Class: Mihari::Structs::BinaryEdge::Response

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/mihari/structs/binaryedge.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventsArray<Event> (readonly)

Returns:



57
# File 'lib/mihari/structs/binaryedge.rb', line 57

attribute :events, Types.Array(Event)

#pageInteger (readonly)

Returns:

  • (Integer)


45
# File 'lib/mihari/structs/binaryedge.rb', line 45

attribute :page, Types::Int

#pagesizeInteger (readonly)

Returns:

  • (Integer)


49
# File 'lib/mihari/structs/binaryedge.rb', line 49

attribute :pagesize, Types::Int

#totalInteger (readonly)

Returns:

  • (Integer)


53
# File 'lib/mihari/structs/binaryedge.rb', line 53

attribute :total, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


70
71
72
73
74
75
76
77
78
# File 'lib/mihari/structs/binaryedge.rb', line 70

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    page: d.fetch("page"),
    pagesize: d.fetch("pagesize"),
    total: d.fetch("total"),
    events: d.fetch("events").map { |x| Event.from_dynamic!(x) }
  )
end

Instance Method Details

#artifactsArray<Artifact>

Returns:

  • (Array<Artifact>)


62
63
64
# File 'lib/mihari/structs/binaryedge.rb', line 62

def artifacts
  events.map { |event| Models::Artifact.new(data: event.target.ip) }
end