Class: BBC::Api
- Inherits:
-
Object
- Object
- BBC::Api
- Defined in:
- lib/bbc/base.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#topics ⇒ Object
Returns the value of attribute topics.
Instance Method Summary collapse
- #build_topics_hash ⇒ Object
-
#initialize ⇒ Api
constructor
A new instance of Api.
Constructor Details
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/bbc/base.rb', line 9 def response @response end |
#topics ⇒ Object
Returns the value of attribute topics.
8 9 10 |
# File 'lib/bbc/base.rb', line 8 def topics @topics end |
Instance Method Details
#build_topics_hash ⇒ Object
23 24 25 |
# File 'lib/bbc/base.rb', line 23 def build_topics_hash @topics.each_with_index.inject({}){|result, (element,i)| result.merge Hash[i.succ, element]} end |