Class: Glaemscribe::API::PrePostProcessorOperator
- Inherits:
-
Object
- Object
- Glaemscribe::API::PrePostProcessorOperator
- Defined in:
- lib/api/transcription_pre_post_processor.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#raw_args ⇒ Object
readonly
Returns the value of attribute raw_args.
Instance Method Summary collapse
- #apply ⇒ Object
- #eval_arg(arg, trans_options) ⇒ Object
- #finalize(trans_options) ⇒ Object
-
#initialize(raw_args) ⇒ PrePostProcessorOperator
constructor
A new instance of PrePostProcessorOperator.
Constructor Details
#initialize(raw_args) ⇒ PrePostProcessorOperator
Returns a new instance of PrePostProcessorOperator.
30 31 32 |
# File 'lib/api/transcription_pre_post_processor.rb', line 30 def initialize(raw_args) @raw_args = raw_args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
27 28 29 |
# File 'lib/api/transcription_pre_post_processor.rb', line 27 def args @args end |
#raw_args ⇒ Object (readonly)
Returns the value of attribute raw_args.
28 29 30 |
# File 'lib/api/transcription_pre_post_processor.rb', line 28 def raw_args @raw_args end |
Instance Method Details
#apply ⇒ Object
50 51 52 |
# File 'lib/api/transcription_pre_post_processor.rb', line 50 def apply raise "Pure virtual method, should be overloaded." end |
#eval_arg(arg, trans_options) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/api/transcription_pre_post_processor.rb', line 34 def eval_arg(arg, ) return nil if arg.nil? if arg =~ /^\\eval\s/ to_eval = $' return Eval::Parser.new().parse(to_eval, ) end return arg end |
#finalize(trans_options) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/api/transcription_pre_post_processor.rb', line 43 def finalize() @args = [] @raw_args.each{ |arg| @args << eval_arg(arg, ) } end |