Skip to content

Commit 8604b67

Browse files
authored
Merge pull request #13 from froydnj/froydnj-fix-logic-errors
fix some logic errors
2 parents b616243 + 3f2962b commit 8604b67

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/message_format.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def format ( args=nil )
2626
class << self
2727

2828
def new ( pattern, locale=nil, raise_on_missing_params: false )
29-
MessageFormat.new(pattern, locale, raise_on_missing_params)
29+
MessageFormat.new(pattern, locale, raise_on_missing_params: raise_on_missing_params)
3030
end
3131

3232
def format_message ( pattern, args=nil, locale=nil, raise_on_missing_params: false )

lib/message_format/interpreter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ def initialize ( message, missing_params )
4848

4949
def interpret ( elements )
5050
@missing_ids = []
51-
interpret_subs(elements)
51+
interpreted = interpret_subs(elements)
5252
if @raise_on_missing_params && !@missing_ids.empty?
5353
raise MissingParametersError.new('Missing parameters detected during interpretation', @missing_ids.compact)
5454
end
55+
interpreted
5556
end
5657

5758
def interpret_subs ( elements, parent=nil )

0 commit comments

Comments
 (0)