Class: Covetous::Shen
Direct Known Subclasses
Data::Artisan, Data::Follower, Data::Item, Profile::Career, Profile::Hero
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url_option, extra_options = {}) ⇒ Shen
constructor
A new instance of Shen.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(url_option, extra_options = {}) ⇒ Shen
Returns a new instance of Shen.
7 8 9 |
# File 'lib/covetous/shen.rb', line 7 def initialize(url_option, ={}) @response = self.class.get @url end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/covetous/shen.rb', line 11 def method_missing(name, *args, &block) camelcased_key = name.to_s.camelize(:lower) if @response.has_key?(camelcased_key) @response[camelcased_key] else super end end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/covetous/shen.rb', line 5 def response @response end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/covetous/shen.rb', line 5 def url @url end |