138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
# File 'ext/jadtfmt.c', line 138
static VALUE jadtfmt_Time_jastrftime(VALUE self, VALUE format) {
VALUE jadtfmt, replace;
Check_Type(format, T_STRING);
jadtfmt = rb_funcall(JapaneseDateFormat, rb_intern("new"), 0);
if (rb_funcall(format, rb_intern("include?"), 1, pph_E)) {
rb_funcall(jadtfmt, rb_intern("apply_pattern"), 1, pph_E_pattern);
replace = rb_funcall(jadtfmt, rb_intern("format"), 1, self);
format = rb_funcall(format, rb_intern("gsub"), 2, pph_E, replace);
}
if (rb_funcall(format, rb_intern("include?"), 1, pph_N)) {
rb_funcall(jadtfmt, rb_intern("apply_pattern"), 1, pph_N_pattern);
replace = rb_funcall(jadtfmt, rb_intern("format"), 1, self);
format = rb_funcall(format, rb_intern("gsub"), 2, pph_N, replace);
}
if (rb_funcall(format, rb_intern("include?"), 1, pph_n)) {
rb_funcall(jadtfmt, rb_intern("apply_pattern"), 1, pph_n_pattern);
replace = rb_funcall(jadtfmt, rb_intern("format"), 1, self);
format = rb_funcall(format, rb_intern("gsub"), 2, pph_n, replace);
}
return rb_funcall(self, rb_intern("strftime"), 1, format);
}
|