Class: SecretIdentifiersResponse

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



1951
1952
1953
1954
1955
1956
# File 'lib/schemas.rb', line 1951

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data: d.fetch("data").map { |x| SecretIdentifierResponse.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



1958
1959
1960
# File 'lib/schemas.rb', line 1958

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



1962
1963
1964
1965
1966
# File 'lib/schemas.rb', line 1962

def to_dynamic
  {
    "data" => data.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



1968
1969
1970
# File 'lib/schemas.rb', line 1968

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end