Class: GetMocksMockIDServerResponsesServerResponseIDResponse400Error

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



11753
11754
11755
11756
11757
11758
11759
# File 'lib/schemas.rb', line 11753

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                                                                      d["message"],
    get_mocks_mock_id_server_responses_server_response_id_response400_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



11761
11762
11763
# File 'lib/schemas.rb', line 11761

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

Instance Method Details

#to_dynamicObject



11765
11766
11767
11768
11769
11770
# File 'lib/schemas.rb', line 11765

def to_dynamic
  {
    "message" => message,
    "name"    => get_mocks_mock_id_server_responses_server_response_id_response400_error_name,
  }
end

#to_json(options = nil) ⇒ Object



11772
11773
11774
# File 'lib/schemas.rb', line 11772

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