Class: Mihari::Structs::Censys::Service

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Service

Parameters:

  • d (Hash)

Returns:



111
112
113
114
115
116
# File 'lib/mihari/structs/censys.rb', line 111

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    port: d.fetch("port")
  )
end

Instance Method Details

#portInteger

Returns:

  • (Integer)


94
95
96
# File 'lib/mihari/structs/censys.rb', line 94

def port
  attributes[:port]
end

#to_portMihari::Port

Returns:



101
102
103
# File 'lib/mihari/structs/censys.rb', line 101

def to_port
  Port.new(port: port)
end