class SslLabs::EndpointData::Details::Sim

Constants

ATTRS

Public Class Methods

from_hash(hash) click to toggle source
# File lib/ssl_labs/endpoint_data/details/sim.rb, line 22
def self.from_hash(hash)
  sim = self.new
  hash.each do |k, v|
    case sym = Util.underscore(k).to_sym
    when :client
      sim.client = Sim::Client.from_hash(v)
    when *ATTRS
      sim.send("#{sym}=", v)
    else
      raise ArgumentError, "Unknown key #{k.inspect} (#{sym.inspect})"
    end
  end
  sim
end