@@ -32,7 +32,7 @@ typedef struct JSON_Generator_StateStruct {
3232} JSON_Generator_State ;
3333
3434static VALUE mJSON , cState , cFragment , eGeneratorError , eNestingError , Encoding_UTF_8 , default_sort_keys_proc ,
35- rfc8785_number_formater_proc , rfc8785_sort_keys_proc ;
35+ rfc8785_number_formatter_proc , rfc8785_sort_keys_proc ;
3636
3737static ID i_to_s , i_to_json , i_new , i_encode ;
3838static VALUE sym_indent , sym_space , sym_space_before , sym_object_nl , sym_array_nl , sym_max_nesting , sym_allow_nan , sym_allow_duplicate_key ,
@@ -1171,7 +1171,7 @@ static void generate_json_float(FBuffer *buffer, struct generate_json_data *data
11711171 }
11721172
11731173 if (RB_UNLIKELY (data -> state -> rfc8785 )) {
1174- VALUE str = rb_proc_call_with_block (rfc8785_number_formater_proc , 1 , & obj , Qnil );
1174+ VALUE str = rb_proc_call_with_block (rfc8785_number_formatter_proc , 1 , & obj , Qnil );
11751175 Check_Type (str , T_STRING );
11761176 fbuffer_append_str (buffer , str );
11771177 return ;
@@ -1754,15 +1754,15 @@ static VALUE cState_set_default_sort_keys_proc(VALUE self, VALUE proc)
17541754 return default_sort_keys_proc = proc ;
17551755}
17561756
1757- static VALUE cState_set_rfc8785_number_formater_proc (VALUE self , VALUE proc )
1757+ static VALUE cState_set_rfc8785_number_formatter_proc (VALUE self , VALUE proc )
17581758{
17591759 if (!rb_obj_is_proc (proc )) {
1760- rb_raise (rb_eTypeError , "rfc8785_number_formater_proc must be a Proc" );
1760+ rb_raise (rb_eTypeError , "rfc8785_number_formatter_proc must be a Proc" );
17611761 }
1762- if (rfc8785_number_formater_proc ) {
1763- rb_raise (rb_eArgError , "rfc8785_number_formater_proc can only be set once" );
1762+ if (rfc8785_number_formatter_proc ) {
1763+ rb_raise (rb_eArgError , "rfc8785_number_formatter_proc can only be set once" );
17641764 }
1765- return rfc8785_number_formater_proc = proc ;
1765+ return rfc8785_number_formatter_proc = proc ;
17661766}
17671767
17681768static VALUE cState_set_rfc8785_sort_keys_proc (VALUE self , VALUE proc )
@@ -2036,7 +2036,7 @@ void Init_generator(void)
20362036 VALUE mGenerator = rb_define_module_under (mExt , "Generator" );
20372037
20382038 rb_global_variable (& default_sort_keys_proc );
2039- rb_global_variable (& rfc8785_number_formater_proc );
2039+ rb_global_variable (& rfc8785_number_formatter_proc );
20402040 rb_global_variable (& rfc8785_sort_keys_proc );
20412041
20422042 rb_global_variable (& eGeneratorError );
@@ -2049,7 +2049,7 @@ void Init_generator(void)
20492049 rb_define_alloc_func (cState , cState_s_allocate );
20502050 rb_define_singleton_method (cState , "from_state" , cState_from_state_s , 1 );
20512051 rb_define_singleton_method (cState , "default_sort_keys_proc=" , cState_set_default_sort_keys_proc , 1 );
2052- rb_define_singleton_method (cState , "rfc8785_number_formater_proc =" , cState_set_rfc8785_number_formater_proc , 1 );
2052+ rb_define_singleton_method (cState , "rfc8785_number_formatter_proc =" , cState_set_rfc8785_number_formatter_proc , 1 );
20532053 rb_define_singleton_method (cState , "rfc8785_sort_keys_proc=" , cState_set_rfc8785_sort_keys_proc , 1 );
20542054
20552055 rb_define_method (cState , "initialize" , cState_initialize , -1 );
0 commit comments