Module: GetText::POEntryForRubyParser

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#advance_to_next_attributeObject


153
154
155
# File 'lib/gettext/tools/parser/ruby.rb', line 153

def advance_to_next_attribute
  @param_number += 1
end

#init_paramObject


148
149
150
151
# File 'lib/gettext/tools/parser/ruby.rb', line 148

def init_param
  @param_number = 0
  self
end

#set_current_attribute(str) ⇒ Object

Supports parsing by setting attributes by and by.

Raises:


142
143
144
145
146
# File 'lib/gettext/tools/parser/ruby.rb', line 142

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