Class: Phlex::Reactive::Inspector::ActionInfo
- Inherits:
-
Data
- Object
- Data
- Phlex::Reactive::Inspector::ActionInfo
- Defined in:
- lib/phlex/reactive/inspector.rb
Overview
One declared action's introspection.
* source_location — klass.instance_method(name).source_location, or nil
when the action is declared but the method is
missing (the endpoint would 500 on public_send).
* definition — the full `def ... end` source, extracted with Prism.
nil when the method is missing or its file is
unreadable/unparseable (degrade, never raise).
* authorization_call_detected? — a HEURISTIC: true when the Prism scan
of the definition finds a call to any configured
authorization method or mark_authorized!. A helper
may authorize indirectly, so this is advisory ONLY.
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#source_location ⇒ Object
readonly
Returns the value of attribute source_location.
Instance Method Summary collapse
-
#authorization_call_detected? ⇒ Boolean
Was any authorization method (or mark_authorized!) called directly in the method body? Heuristic — a Prism scan of
definition.
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition
34 35 36 |
# File 'lib/phlex/reactive/inspector.rb', line 34 def definition @definition end |
#name ⇒ Object (readonly)
Returns the value of attribute name
34 35 36 |
# File 'lib/phlex/reactive/inspector.rb', line 34 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params
34 35 36 |
# File 'lib/phlex/reactive/inspector.rb', line 34 def params @params end |
#source_location ⇒ Object (readonly)
Returns the value of attribute source_location
34 35 36 |
# File 'lib/phlex/reactive/inspector.rb', line 34 def source_location @source_location end |
Instance Method Details
#authorization_call_detected? ⇒ Boolean
Was any authorization method (or mark_authorized!) called directly in
the method body? Heuristic — a Prism scan of definition. False when
the definition is unavailable.
38 39 40 41 42 |
# File 'lib/phlex/reactive/inspector.rb', line 38 def return false unless definition Inspector.(definition) end |