Class: Pupil::Scheme
- Inherits:
-
Object
- Object
- Pupil::Scheme
- Includes:
- Essentials
- Defined in:
- lib/pupil/schemes.rb
Direct Known Subclasses
DirectMessage, Entities, Hashtag, List, Status, URL, User, UserMention
Instance Method Summary collapse
-
#initialize(element, access_token = nil) ⇒ Scheme
constructor
A new instance of Scheme.
- #params ⇒ Object (also: #available_methods)
Methods included from Essentials
#get, #guess_parameter, #post, #serialize_parameter
Constructor Details
#initialize(element, access_token = nil) ⇒ Scheme
Returns a new instance of Scheme.
12 13 14 15 |
# File 'lib/pupil/schemes.rb', line 12 def initialize(element, access_token=nil) @access_token = access_token @element = element end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(action, *args) ⇒ Object (protected)
6 7 8 |
# File 'lib/pupil/schemes.rb', line 6 def method_missing(action, *args) return @element[action.to_s] rescue nil end |
Instance Method Details
#params ⇒ Object Also known as: available_methods
17 |
# File 'lib/pupil/schemes.rb', line 17 def params() @element.keys.map{|k|k.to_sym} ; end |