Class: CGSize
- Inherits:
-
Object
- Object
- CGSize
- Defined in:
- lib/project/cg_size.rb
Class Method Summary collapse
-
.golden_section(options) ⇒ CGSize
The new CGSize object.
Instance Method Summary collapse
-
#golden_section(direction = :both, exp = 1) ⇒ CGSize
The new object.
Class Method Details
.golden_section(options) ⇒ CGSize
Returns the new CGSize object.
7 8 9 |
# File 'lib/project/cg_size.rb', line 7 def self.golden_section() Golden_Sections::handler(Golden_Sections::CGSize_relations, , &Golden_Sections::CGSize_proc) end |
Instance Method Details
#golden_section(direction = :both, exp = 1) ⇒ CGSize
Returns the new object.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/project/cg_size.rb', line 16 def golden_section(direction=:both, exp=1) if direction==:both CGSize.new(self.width.golden_section(exp), self.height.golden_section(exp)) elsif direction==:width CGSize.new(self.width.golden_section(exp), self.height) elsif direction==:height CGSize.new(self.width, self.height.golden_section(exp)) else raise "CGSize#golden_section: unknown direction #{direction}" end end |