0.0
Low commit activity in last 3 years
No release in over a year
Uses the Parser gem to primarily return the defined methods for the class
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.2, >= 3.2.1.0
~> 1.5, >= 1.5.14
~> 1.0, >= 1.0.8
 Project Readme

Introducing the method_parser gem

require 'method_parser'

mp = MethodParser.new File.read('simple_number.rb')
mp.to_a

output:

[
  [:class, :SimpleNumber, 
    [
      [:def, :initialize, :private], 
      [:def, :add, :public], 
      [:def, :multiply, :public], 
      [:def, :divide, :private], 
      [:def, :square, :protected]
    ]
  ]
] 
  • update: 9:35pm 15th Sep 2014 *

Implemented to_xml

require 'method_parser'

mp = MethodParser.new File.read('simple_number.rb')
mp.to_xml

output:

<?xml version='1.0' encoding='UTF-8'?>
<doc>
  <klass name='SimpleNumber'>
    <def name='initialize' scope='private'></def>
    <def name='add' scope='public'></def>
    <def name='multiply' scope='public'></def>
    <def name='divide' scope='private'></def>
    <def name='square' scope='protected'></def>
  </klass>
</doc>

Resources

parser gem method_parser