class Golden_Sections
Golden_Sections
handler for common methods
Constants
- CGPoint_proc
CGPoint
initializer- CGPoint_relations
Relations of
CGPoint
attributes- CGRect_proc
CGRect
initializer- CGRect_relations
Relations of
CGRect
attributes- CGSize_proc
CGSize
initializer- CGSize_relations
Relations of
CGSize
attributes- Golden_Mean
The all-important golden mean
- Version
The version of golden-sections
Public Class Methods
handler(relations, options, &init)
click to toggle source
A common handler for golden_section methods @param relations [Hash] the set of relations to use @param options [Hash] the options passed by the user @param init [Proc] the initialization method to call
# File lib/project/handler.rb, line 9 def self.handler(relations, options, &init) options[:exponent]||=1 relations.each do |relation1, relation2| if options[relation1]&&!options[relation2] options[relation2]=options[relation1].golden_section(options[:exponent]) elsif options[relation2]&&!options[relation1] options[relation1]=options[relation2].golden_section(options[:exponent]) end end init.call(options) end