Class: LoginURI

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



2725
2726
2727
2728
2729
2730
2731
2732
# File 'lib/schemas.rb', line 2725

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    match:        d["match"],
    uri:          d["uri"],
    uri_checksum: d["uriChecksum"],
  )
end

.from_json!(json) ⇒ Object



2734
2735
2736
# File 'lib/schemas.rb', line 2734

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

Instance Method Details

#to_dynamicObject



2738
2739
2740
2741
2742
2743
2744
# File 'lib/schemas.rb', line 2738

def to_dynamic
  {
    "match"       => match,
    "uri"         => uri,
    "uriChecksum" => uri_checksum,
  }
end

#to_json(options = nil) ⇒ Object



2746
2747
2748
# File 'lib/schemas.rb', line 2746

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