Class: ScalarGalaxy::Resources::CelestialBodies

Inherits:
Object
  • Object
show all
Defined in:
lib/galaxy-ruby/resources/celestial_bodies.rb,
sig/galaxy-ruby/resources/celestial_bodies.rbs

Overview

Celestial bodies are the planets and satellites in the Scalar Galaxy.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CelestialBodies

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CelestialBodies.

Parameters:



32
33
34
# File 'lib/galaxy-ruby/resources/celestial_bodies.rb', line 32

def initialize(client:)
  @client = client
end

Instance Method Details

#create(celestial_body:, request_options: {}) ⇒ ScalarGalaxy::Models::Planet, ScalarGalaxy::Models::CelestialBody::Satellite

Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts through the void, you can add it here.



18
19
20
21
22
23
24
25
26
27
# File 'lib/galaxy-ruby/resources/celestial_bodies.rb', line 18

def create(params)
  parsed, options = ScalarGalaxy::CelestialBodyCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "celestial-bodies",
    body: parsed[:celestial_body],
    model: ScalarGalaxy::CelestialBody,
    options: options
  )
end