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



782
783
784
785
786
787
# File 'lib/schemas.rb', line 782

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

.from_json!(json) ⇒ Object



789
790
791
# File 'lib/schemas.rb', line 789

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

Instance Method Details

#to_dynamicObject



793
794
795
796
797
# File 'lib/schemas.rb', line 793

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

#to_json(options = nil) ⇒ Object



799
800
801
# File 'lib/schemas.rb', line 799

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