Class: Starwars::Planet
- Inherits:
-
Base
- Object
- OpenStruct
- Base
- Starwars::Planet
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
#created ⇒ Time
30
|
# File 'lib/starwars/planet.rb', line 30
property :created, type: Time
|
#id ⇒ Integer
22
|
# File 'lib/starwars/planet.rb', line 22
property :id, type: Integer
|
#name ⇒ String
15
|
# File 'lib/starwars/planet.rb', line 15
property :name
|
#residents ⇒ Array
34
|
# File 'lib/starwars/planet.rb', line 34
collection :residents, class: Starwars::Person, deserialize: ->(_, fragment, _) { Person.new(url: fragment) }
|