Module: GetText::PoMessageForRubyParser

Included in:
PoMessage
Defined in:
lib/gettext/tools/parser/ruby.rb

Overview

Extends PoMessage for RubyParser. Implements a sort of state machine to assist the parser.

Instance Method Summary collapse

Instance Method Details

#advance_to_next_attributeObject



97
98
99
# File 'lib/gettext/tools/parser/ruby.rb', line 97

def advance_to_next_attribute
  @param_number += 1
end

#init_paramObject



92
93
94
95
# File 'lib/gettext/tools/parser/ruby.rb', line 92

def init_param
  @param_number = 0
  self
end

#set_current_attribute(str) ⇒ Object

Supports parsing by setting attributes by and by.

Raises:



86
87
88
89
90
# File 'lib/gettext/tools/parser/ruby.rb', line 86

def set_current_attribute(str)
  param = @param_type[@param_number]
  raise ParseError, 'no more string parameters expected' unless param
  set_value(param, str)
end