Class: Mihari::Structs::HunterHow::DataClass

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#listArray<ListItem> (readonly)

Returns:



44
# File 'lib/mihari/structs/hunterhow.rb', line 44

attribute :list, Types.Array(ListItem)

#totalInteger (readonly)

Returns:

  • (Integer)


48
# File 'lib/mihari/structs/hunterhow.rb', line 48

attribute :total, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


61
62
63
64
65
66
67
# File 'lib/mihari/structs/hunterhow.rb', line 61

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

Instance Method Details

#artifactsArray<Mihari::Models::Artifact>

Returns:



53
54
55
# File 'lib/mihari/structs/hunterhow.rb', line 53

def artifacts
  list.map(&:artifact)
end