Class: Ryan
- Inherits:
-
Object
- Object
- Ryan
- Extended by:
- Forwardable
- Defined in:
- lib/ryan.rb,
lib/ryan/version.rb,
lib/ryan/assignment.rb
Defined Under Namespace
Classes: Assignment, ClassFunc, Condition, Const, Func, InstanceFunc, SexpDecorator
Constant Summary collapse
- VERSION =
'1.2.1'.freeze
Instance Attribute Summary collapse
-
#const ⇒ Object
readonly
Returns the value of attribute const.
-
#sexp ⇒ Object
readonly
Returns the value of attribute sexp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input) ⇒ Ryan
constructor
A new instance of Ryan.
Constructor Details
#initialize(input) ⇒ Ryan
Note:
Attempts to read a file if a path is given, otherwise threats input as ruby code string
Returns a new instance of Ryan.
27 28 29 30 31 |
# File 'lib/ryan.rb', line 27 def initialize(input) input = File.read(input) if File.file?(input) @sexp = RubyParser.new.parse(input) @const = Const.new(sexp) end |
Instance Attribute Details
#const ⇒ Object (readonly)
Returns the value of attribute const.
14 15 16 |
# File 'lib/ryan.rb', line 14 def const @const end |
#sexp ⇒ Object (readonly)
Returns the value of attribute sexp.
14 15 16 |
# File 'lib/ryan.rb', line 14 def sexp @sexp end |
Class Method Details
.root ⇒ Object
21 22 23 |
# File 'lib/ryan.rb', line 21 def self.root Pathname.new File.('../..', __FILE__) end |