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



1804
1805
1806
1807
1808
1809
# File 'lib/schemas.rb', line 1804

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



1811
1812
1813
# File 'lib/schemas.rb', line 1811

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

Instance Method Details

#to_dynamicObject



1815
1816
1817
1818
1819
# File 'lib/schemas.rb', line 1815

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

#to_json(options = nil) ⇒ Object



1821
1822
1823
# File 'lib/schemas.rb', line 1821

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