Class: JsxRosetta::IR::StimulusMethod

Inherits:
Data
  • Object
show all
Includes:
Node
Defined in:
lib/jsx_rosetta/ir/types.rb

Overview

A handler method to be emitted on the generated Stimulus controller. Body translation is deferred to the human reviewer; we preserve the original JS body verbatim.

name : String — camelCase Stimulus method name (uniquified

when two handlers collide on the same base name).

body_source : String — verbatim JS body (the entire arrow function

or the function expression body), preserved as a
comment in the emitted controller skeleton.

original_name : String — the requested base name before uniquification.

Equals `name` when there was no collision. When
`name != original_name`, backends emit a collision
marker comment in the generated controller JS so the
reviewer can see the silent rename.

Instance Attribute Summary collapse

Instance Attribute Details

#body_sourceObject (readonly)

Returns the value of attribute body_source

Returns:

  • (Object)

    the current value of body_source



282
283
284
# File 'lib/jsx_rosetta/ir/types.rb', line 282

def body_source
  @body_source
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



282
283
284
# File 'lib/jsx_rosetta/ir/types.rb', line 282

def name
  @name
end

#original_nameObject (readonly)

Returns the value of attribute original_name

Returns:

  • (Object)

    the current value of original_name



282
283
284
# File 'lib/jsx_rosetta/ir/types.rb', line 282

def original_name
  @original_name
end