Class: Rabbit::RelativeSize
- Inherits:
-
Object
- Object
- Rabbit::RelativeSize
- Defined in:
- lib/rabbit/relative-size.rb
Instance Method Summary collapse
-
#initialize(size) ⇒ RelativeSize
constructor
A new instance of RelativeSize.
- #resolve(base_size) ⇒ Object
Constructor Details
#initialize(size) ⇒ RelativeSize
Returns a new instance of RelativeSize.
19 20 21 |
# File 'lib/rabbit/relative-size.rb', line 19 def initialize(size) @size = size end |
Instance Method Details
#resolve(base_size) ⇒ Object
23 24 25 26 |
# File 'lib/rabbit/relative-size.rb', line 23 def resolve(base_size) return nil if base_size.nil? ((@size / 100.0) * base_size).ceil end |