Class: Sexp

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_parser_extras.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



700
701
702
# File 'lib/ruby_parser_extras.rb', line 700

def comments
  @comments
end

#parenObject



706
707
708
# File 'lib/ruby_parser_extras.rb', line 706

def paren
  @paren ||= false
end

Instance Method Details

#node_typeObject



702
703
704
# File 'lib/ruby_parser_extras.rb', line 702

def node_type
  first
end

#to_symObject



715
716
717
# File 'lib/ruby_parser_extras.rb', line 715

def to_sym
  self.value.to_sym
end

#valueObject



710
711
712
713
# File 'lib/ruby_parser_extras.rb', line 710

def value
  raise "multi item sexp" if size > 2
  last
end

#valuesObject



719
720
721
# File 'lib/ruby_parser_extras.rb', line 719

def values
  self[1..-1]
end