Class: APIStore
- Inherits:
-
Object
- Object
- APIStore
- Defined in:
- lib/api_roulette/api_store.rb
Instance Attribute Summary collapse
-
#apis ⇒ Object
readonly
Returns the value of attribute apis.
Instance Method Summary collapse
- #get_random_api(quantity) ⇒ Object
-
#initialize(apis) ⇒ APIStore
constructor
A new instance of APIStore.
Constructor Details
#initialize(apis) ⇒ APIStore
Returns a new instance of APIStore.
4 5 6 |
# File 'lib/api_roulette/api_store.rb', line 4 def initialize(apis) @apis = apis end |
Instance Attribute Details
#apis ⇒ Object (readonly)
Returns the value of attribute apis.
2 3 4 |
# File 'lib/api_roulette/api_store.rb', line 2 def apis @apis end |
Instance Method Details
#get_random_api(quantity) ⇒ Object
8 9 10 |
# File 'lib/api_roulette/api_store.rb', line 8 def get_random_api(quantity) @apis.sample(quantity) end |