Class: ProjectGetRequest

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



884
885
886
887
888
889
# File 'lib/schemas.rb', line 884

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id: d.fetch("id"),
  )
end

.from_json!(json) ⇒ Object



891
892
893
# File 'lib/schemas.rb', line 891

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

Instance Method Details

#to_dynamicObject



895
896
897
898
899
# File 'lib/schemas.rb', line 895

def to_dynamic
  {
    "id" => id,
  }
end

#to_json(options = nil) ⇒ Object



901
902
903
# File 'lib/schemas.rb', line 901

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