Method: Quantify::Unit::Base#method_missing
- Defined in:
- lib/quantify/unit/base_unit.rb
#method_missing(method, *args, &block) ⇒ Object (private)
574 575 576 577 578 579 580 581 |
# File 'lib/quantify/unit/base_unit.rb', line 574 def method_missing(method, *args, &block) if method.to_s =~ /(to_)(.*)/ && prefix = Prefix.for($2.to_sym) return self.with_prefix(prefix) elsif method.to_s =~ /(alternatives_by_)(.*)/ && self.respond_to?($2.to_sym) return self.alternatives($2.to_sym) end super end |