Class: Ryan

Inherits:
Object
  • Object
show all
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.1.0'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • input (Pathname, String)


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

#constObject (readonly)

Returns the value of attribute const.



14
15
16
# File 'lib/ryan.rb', line 14

def const
  @const
end

#sexpObject (readonly)

Returns the value of attribute sexp.



14
15
16
# File 'lib/ryan.rb', line 14

def sexp
  @sexp
end

Class Method Details

.rootObject



21
22
23
# File 'lib/ryan.rb', line 21

def self.root
  Pathname.new File.expand_path('../..', __FILE__)
end