class Gsk::RoundedRect
Public Class Methods
Source
# File lib/gsk4/rounded-rect.rb, line 50 def initialize(*args) super() case args.size when 0 when 1 init_copy(args[0]) when 2 init_from_rect(args[0], args[1]) when 5 init(*args) else message = +"wrong number of arguments " message << "(given #{args.size}, expected 0, 1, 2 or 5)" raise ArgumentError, message end end
Calls superclass method
Also aliased as: initialize_raw
Source
# File lib/gsk4/rounded-rect.rb, line 20 def try_convert(value) case value when Array n_values = value.size return nil if n_values < 2 bounds = Graphene::Rect.try_convert(value[0]) return nil if bounds.nil? case n_values when 2 radius = value[1] new(bounds, radius) when 5 corners = [] (1..4).each do |i| corner = Graphene::Size.try_convert(value[i]) return nil if corner.nil? corners << corner end new(bounds, *corners) else nil end else nil end end
Public Instance Methods
Source
# File lib/gsk4/rounded-rect.rb, line 67 def ==(other) other.is_a?(self.class) and bounds == other.bounds and corners == other.corners end
Source
# File lib/gsk4/rounded-rect.rb, line 73 def inspect super.sub(/>\z/) do " bounds=#{bounds.inspect} corners=#{corners.inspect}>" end end
Calls superclass method