Class: AccessorHandler
- Inherits:
-
Object
- Object
- AccessorHandler
- Defined in:
- lib/ruby_diff/structure_processor.rb
Instance Method Summary collapse
-
#initialize(label) ⇒ AccessorHandler
constructor
A new instance of AccessorHandler.
- #meta_codes(args_sexp, scope) ⇒ Object
- #name_for_arg(name_sexp) ⇒ Object
Constructor Details
#initialize(label) ⇒ AccessorHandler
Returns a new instance of AccessorHandler.
73 74 75 |
# File 'lib/ruby_diff/structure_processor.rb', line 73 def initialize(label) @label = label end |
Instance Method Details
#meta_codes(args_sexp, scope) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/ruby_diff/structure_processor.rb', line 77 def (args_sexp, scope) = [] args_sexp.sexp_body.each do |arg| if name = name_for_arg(arg) << MetaCode.new(name, scope, @label) end end end |
#name_for_arg(name_sexp) ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/ruby_diff/structure_processor.rb', line 87 def name_for_arg(name_sexp) identifier = name_sexp.to_a case identifier.first when :lit then identifier.last when :str then identifier.last.to_sym else nil end end |