Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to convert from a subclassed dimension unit to a parent unit or viceversa #9

Open
waiting-for-dev opened this issue Jul 21, 2013 · 0 comments

Comments

@waiting-for-dev
Copy link

class Screen < Quantity::Dimension::Length; end;
Screen.add_dimension :screen

Quantity::Unit.add_unit :px, :screen, 233333, :pixel, :pixels

puts 3.cm.to_px

Returns:

/var/lib/gems/1.9.1/gems/quantity-0.1.2/lib/quantity/unit.rb:236:in `convert': Cannot convert #<Quantity::Unit:0x000000015f68c8> to cm (ArgumentError)
        from /var/lib/gems/1.9.1/gems/quantity-0.1.2/lib/quantity.rb:331:in `convert'
        from /var/lib/gems/1.9.1/gems/quantity-0.1.2/lib/quantity.rb:354:in `method_missing'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant