Class: Ionize::Php::Translate::Php2Ruby
- Inherits:
-
Ruby2Ruby
- Object
- Ruby2Ruby
- Ionize::Php::Translate::Php2Ruby
- Defined in:
- lib/ionize/translate/php_to_ruby.rb
Instance Method Summary collapse
- #process_erb_end(exp) ⇒ Object
- #process_erb_start(exp) ⇒ Object
- #process_hash(exp) ⇒ Object
- #process_html(exp) ⇒ Object
- #process_php(exp) ⇒ Object
Instance Method Details
#process_erb_end(exp) ⇒ Object
33 34 35 |
# File 'lib/ionize/translate/php_to_ruby.rb', line 33 def process_erb_end(exp) exp.shift end |
#process_erb_start(exp) ⇒ Object
29 30 31 |
# File 'lib/ionize/translate/php_to_ruby.rb', line 29 def process_erb_start(exp) exp.shift end |
#process_hash(exp) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ionize/translate/php_to_ruby.rb', line 8 def process_hash(exp) result = [] until exp.empty? result << "#{process(exp.shift)} => #{process(exp.shift)}" end "{#{result.join(', ')}}" end |
#process_html(exp) ⇒ Object
25 26 27 |
# File 'lib/ionize/translate/php_to_ruby.rb', line 25 def process_html(exp) exp.shift end |
#process_php(exp) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ionize/translate/php_to_ruby.rb', line 16 def process_php(exp) str = "" until exp.empty? subexp = exp.shift str << process(subexp) end str end |