Class: Starwars::Planet

Inherits:
Base
  • Object
show all
Includes:
Fetcher
Defined in:
lib/starwars/planet.rb,
lib/starwars.rb

Overview

A Planet resource is a large mass, planet or planetoid in the Star Wars Universe, at the time of 0 ABY.

Constant Summary collapse

RESOURCE_NAME =

Define the source name in the starwars api

'planets'

Constants inherited from Base

Base::BASE_URL, Base::FORMAT

Instance Method Summary collapse

Methods included from Fetcher

included

Methods inherited from Base

#==, #fetch, fetch

Instance Method Details

#createdTime



30
# File 'lib/starwars/planet.rb', line 30

property :created, type: Time

#idInteger



22
# File 'lib/starwars/planet.rb', line 22

property :id, type: Integer

#nameString



15
# File 'lib/starwars/planet.rb', line 15

property :name

#residentsArray



34
# File 'lib/starwars/planet.rb', line 34

collection :residents, class: Starwars::Person,  deserialize: ->(_, fragment, _) { Person.new(url: fragment) }