Class: Super::Form::FieldTranscript
- Inherits:
-
Object
- Object
- Super::Form::FieldTranscript
- Defined in:
- lib/super/form/field_transcript.rb
Overview
Holds a recording of a form field definition
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
Instance Method Summary collapse
-
#initialize ⇒ FieldTranscript
constructor
A new instance of FieldTranscript.
- #method_missing(new_method_name, *args, **kwargs) ⇒ Object
- #super ⇒ Object
- #super? ⇒ Boolean
Constructor Details
#initialize ⇒ FieldTranscript
Returns a new instance of FieldTranscript.
7 8 9 |
# File 'lib/super/form/field_transcript.rb', line 7 def initialize @super = false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(new_method_name, *args, **kwargs) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/super/form/field_transcript.rb', line 24 def method_missing(new_method_name, *args, **kwargs) if @method_name.present? method_chain = if super? "super.#{@method_name}" else @method_name.to_s end raise Error::AlreadyTranscribed, "This instance already holds a transcription for: #{method_chain}" end @method_name = new_method_name @args = args @kwargs = kwargs @method_name end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
12 13 14 |
# File 'lib/super/form/field_transcript.rb', line 12 def args @args end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
13 14 15 |
# File 'lib/super/form/field_transcript.rb', line 13 def kwargs @kwargs end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
11 12 13 |
# File 'lib/super/form/field_transcript.rb', line 11 def method_name @method_name end |
Instance Method Details
#super ⇒ Object
15 16 17 18 |
# File 'lib/super/form/field_transcript.rb', line 15 def super @super = true self end |
#super? ⇒ Boolean
20 21 22 |
# File 'lib/super/form/field_transcript.rb', line 20 def super? @super end |