Class: MiracleGrow::Plant
- Inherits:
-
Object
- Object
- MiracleGrow::Plant
- Defined in:
- lib/miracle_grow/plant.rb
Class Method Summary collapse
Class Method Details
.all_plant_names ⇒ Object
11 12 13 |
# File 'lib/miracle_grow/plant.rb', line 11 def all_plant_names all_the_plants.map {|plant| plant["name"] } end |
.all_the_plants ⇒ Object
6 7 8 9 |
# File 'lib/miracle_grow/plant.rb', line 6 def all_the_plants response = Faraday.get("#{ENV["HOST"]}/api/v1/plants") JSON.parse(response.body) end |