Class: Starwars::Starship
- Inherits:
-
Base
- Object
- OpenStruct
- Base
- Starwars::Starship
- Defined in:
- lib/starwars/resources/starship.rb,
lib/starwars.rb
Overview
A Starship resource is a single transport craft that has hyperdrive capability.
Constant Summary collapse
- RESOURCE_NAME =
Define the source name in the starwars api
'starships'
Constants inherited from Base
Instance Method Summary collapse
-
#cargo_capacity ⇒ Integer
The maximum number of kilograms that this starship can transport.
-
#consumables ⇒ String
consumables.
-
#cost_in_credits ⇒ String
The cost of this new starship, in Galactic Credits.
-
#crew ⇒ Integer
The number of personnel needed to run or pilot this starship.
-
#films ⇒ Array<Film>
List of films.
-
#hyperdrive_rating ⇒ Float
The class of this starships hyperdrive.
-
#length ⇒ String
The length of this starship in meters.
-
#manufacturer ⇒ String
The manufacturer of the starship.
-
#max_atmosphering_speed ⇒ Integer
The maximum speed of this starship in atmosphere.
-
#model ⇒ String
The model or official name of this starship.
-
#name ⇒ String
The name of this starship.
-
#passengers ⇒ Integer
The number of non-essential people this starship can transport.
-
#pilots ⇒ Array<Pilot>
List of pilots.
-
#starship_class ⇒ String
The class of this starship.
Methods inherited from Base
#==, #created, #edited, fetch, #fetch, fetch_all, #id, #request_attributes, #url
Methods inherited from OpenStruct
Instance Method Details
#cargo_capacity ⇒ Integer
The maximum number of kilograms that this starship can transport
91 |
# File 'lib/starwars/resources/starship.rb', line 91 property :cargo_capacity, type: Integer |
#consumables ⇒ String
consumables
49 |
# File 'lib/starwars/resources/starship.rb', line 49 property :consumables |
#cost_in_credits ⇒ String
The cost of this new starship, in Galactic Credits
56 |
# File 'lib/starwars/resources/starship.rb', line 56 property :cost_in_credits, type: Integer |
#crew ⇒ Integer
The number of personnel needed to run or pilot this starship
77 |
# File 'lib/starwars/resources/starship.rb', line 77 property :crew, type: Integer |
#films ⇒ Array<Film>
List of films
113 |
# File 'lib/starwars/resources/starship.rb', line 113 collection :films, class: Starwars::Film, deserialize: ->(_, fragment, _) { Film.new(url: fragment) } |
#hyperdrive_rating ⇒ Float
The class of this starships hyperdrive
99 |
# File 'lib/starwars/resources/starship.rb', line 99 property :hyperdrive_rating, type: Float |
#length ⇒ String
The length of this starship in meters
63 |
# File 'lib/starwars/resources/starship.rb', line 63 property :length, type: Integer |
#manufacturer ⇒ String
The manufacturer of the starship
35 |
# File 'lib/starwars/resources/starship.rb', line 35 property :manufacturer |
#max_atmosphering_speed ⇒ Integer
The maximum speed of this starship in atmosphere
70 |
# File 'lib/starwars/resources/starship.rb', line 70 property :max_atmosphering_speed, type: Integer |
#model ⇒ String
The model or official name of this starship
28 |
# File 'lib/starwars/resources/starship.rb', line 28 property :model |
#name ⇒ String
The common name, such as “Death Star”.
The name of this starship
20 |
# File 'lib/starwars/resources/starship.rb', line 20 property :name |
#passengers ⇒ Integer
The number of non-essential people this starship can transport
84 |
# File 'lib/starwars/resources/starship.rb', line 84 property :passengers, type: Integer |
#pilots ⇒ Array<Pilot>
List of pilots
106 |
# File 'lib/starwars/resources/starship.rb', line 106 collection :pilots, class: Starwars::Person, deserialize: ->(_, fragment, _) { Person.new(url: fragment) } |
#starship_class ⇒ String
The class of this starship
42 |
# File 'lib/starwars/resources/starship.rb', line 42 property :starship_class |