Class: Ariadne::Seam
- Inherits:
-
Object
- Object
- Ariadne::Seam
- Defined in:
- lib/ariadne/seam.rb
Defined Under Namespace
Classes: Parameter
Instance Attribute Summary collapse
-
#binding ⇒ Object
readonly
Returns the value of attribute binding.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#return_value ⇒ Object
readonly
Returns the value of attribute return_value.
Class Method Summary collapse
-
.build(tracepoint, rank:, depth:) ⇒ Object
We cannot make public methods because accessing the TracePoint after it has been disabled would raise a RunTimeError with message “access from outside”.
Instance Attribute Details
#binding ⇒ Object (readonly)
Returns the value of attribute binding.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def binding @binding end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def depth @depth end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def klass @klass end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def method_name @method_name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def parameters @parameters end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def path @path end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def prefix @prefix end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def rank @rank end |
#return_value ⇒ Object (readonly)
Returns the value of attribute return_value.
7 8 9 |
# File 'lib/ariadne/seam.rb', line 7 def return_value @return_value end |
Class Method Details
.build(tracepoint, rank:, depth:) ⇒ Object
We cannot make public methods because accessing the TracePoint after it has been disabled would raise a RunTimeError with message “access from outside”. We need to set the values while the TracePoint is enabled.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ariadne/seam.rb', line 16 def build(tracepoint, rank:, depth:) raise "tracepoint is disabled" unless tracepoint.enabled? new(rank: rank, depth: depth).tap do |seam| seam.instance_variable_set(:@klass, klass(tracepoint)) seam.instance_variable_set(:@prefix, prefix(tracepoint)) seam.instance_variable_set(:@method_name, method_name(tracepoint)) seam.instance_variable_set(:@parameters, parameters(tracepoint)) seam.instance_variable_set(:@path, path(tracepoint)) end end |