Module: Rubeus::Extensions::Java::Awt::Dimension::ClassMethods
- Defined in:
- lib/rubeus/extensions/java/awt/dimension.rb
Instance Method Summary collapse
Instance Method Details
#create(*args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rubeus/extensions/java/awt/dimension.rb', line 8 def create(*args) values = args if args.length == 0 return new elsif args.length == 1 if args.first.is_a?(Array) return create(*args.first) elsif args.first.is_a?(Rubeus::Awt::Dimension) return args.first else values = args.first.to_s.split("x", 2) end end if values.length == 2 new(*values.map{|s|s.to_i}) else raise ArgumentError, "Unsupported arguments: #{args.inspect}" end end |