Class: Simplabs::Excellent::Parsing::CallContext
- Inherits:
-
SexpContext
- Object
- SexpContext
- Simplabs::Excellent::Parsing::CallContext
- Includes:
- Comparable
- Defined in:
- lib/simplabs/excellent/parsing/call_context.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Attributes inherited from SexpContext
Instance Method Summary collapse
- #<=>(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(exp, parent) ⇒ CallContext
constructor
A new instance of CallContext.
Methods inherited from SexpContext
Constructor Details
#initialize(exp, parent) ⇒ CallContext
Returns a new instance of CallContext.
14 15 16 17 18 19 20 21 |
# File 'lib/simplabs/excellent/parsing/call_context.rb', line 14 def initialize(exp, parent) super @receiver = exp[1].is_a?(Sexp) ? (exp[1][1].nil? ? exp[1][2].to_s : exp[1][1].to_s) : nil @method = exp[2].to_s @full_name = [@receiver, @method].compact.join('.') record_validation record_call end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Simplabs::Excellent::Parsing::SexpContext
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
12 13 14 |
# File 'lib/simplabs/excellent/parsing/call_context.rb', line 12 def method @method end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
11 12 13 |
# File 'lib/simplabs/excellent/parsing/call_context.rb', line 11 def receiver @receiver end |
Instance Method Details
#<=>(other) ⇒ Object Also known as: eql?
23 24 25 |
# File 'lib/simplabs/excellent/parsing/call_context.rb', line 23 def <=>(other) @full_name <=> other.full_name end |
#hash ⇒ Object
28 29 30 |
# File 'lib/simplabs/excellent/parsing/call_context.rb', line 28 def hash @full_name.hash end |