Sha256: 58155be9a1231984b9d3b90023776c0ee2ebc3e2f0fe891e5ea44b139b5629fd
Contents?: true
Size: 864 Bytes
Versions: 3
Compression:
Stored size: 864 Bytes
Contents
# encoding: utf-8 module Github class API # Returns all API public methods for a given class. def self.inherited(klass) klass.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def self.actions self.new.api_methods_in(#{klass}) end def actions api_methods_in(#{klass}) end RUBY_EVAL super end def api_methods_in(klass) puts "---" (klass.send(:instance_methods, false) - ['actions']).sort.each do |rest_met| puts "|--> #{rest_met}" end klass.included_modules.each do |mod| if mod.to_s =~ /#{klass}/ puts "| \\ #{mod.to_s}" mod.instance_methods(false).each do |met| puts "| |--> #{met}" end puts "| /" end end puts "---" nil end end # API end # Github
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
github_api-0.4.3 | lib/github_api/api/actions.rb |
github_api-0.4.2 | lib/github_api/api/actions.rb |
github_api-0.4.1 | lib/github_api/api/actions.rb |