Class: Main
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(json_file) ⇒ Main
constructor
A new instance of Main.
- #people ⇒ Object
- #starships ⇒ Object
- #vehicles ⇒ Object
Methods included from Finder
#find_by_key_value, #find_by_name
Constructor Details
#initialize(json_file) ⇒ Main
Returns a new instance of Main.
19 20 21 |
# File 'lib/testLau.rb', line 19 def initialize(json_file) @db = JSON.parse(File.read(json_file)) end |
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
15 16 17 |
# File 'lib/testLau.rb', line 15 def db @db end |
Instance Method Details
#people ⇒ Object
23 24 25 |
# File 'lib/testLau.rb', line 23 def people @db['people'] end |
#starships ⇒ Object
31 32 33 |
# File 'lib/testLau.rb', line 31 def starships @db['starships'] end |
#vehicles ⇒ Object
27 28 29 |
# File 'lib/testLau.rb', line 27 def vehicles @db['vehicles'] end |