Class: Pupil::Scheme

Inherits:
Object
  • Object
show all
Includes:
Essentials
Defined in:
lib/pupil/schemes.rb

Direct Known Subclasses

DirectMessage, Entities, Hashtag, List, Status, URL, User, UserMention

Instance Method Summary collapse

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

#paramsObject Also known as: available_methods



17
# File 'lib/pupil/schemes.rb', line 17

def params() @element.keys.map{|k|k.to_sym} ; end