Class: API
- Inherits:
-
Object
- Object
- API
- Defined in:
- lib/api_roulette/api.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(params) ⇒ API
constructor
A new instance of API.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ API
Returns a new instance of API.
3 4 5 6 7 8 |
# File 'lib/api_roulette/api.rb', line 3 def initialize(params) @url = params.fetch(:url) @title = params.fetch(:title) @description = params.fetch(:description) @category = params.fetch(:category) end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
2 3 4 |
# File 'lib/api_roulette/api.rb', line 2 def category @category end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
2 3 4 |
# File 'lib/api_roulette/api.rb', line 2 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'lib/api_roulette/api.rb', line 2 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
2 3 4 |
# File 'lib/api_roulette/api.rb', line 2 def url @url end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/api_roulette/api.rb', line 10 def to_s "(#{@category}) #{@title} - #{@url}" end |