Sha256: 8dab23d12172580f2db474c4911f3532ac29913ccbf3d8291b12c66e1f267907

Contents?: true

Size: 495 Bytes

Versions: 5

Compression:

Stored size: 495 Bytes

Contents

module Wx

  # Mixin module providing Array extensions.
  module ArrayExt

    def to_size
      w, h = self
      Wx::Size.new(w || Wx::DEFAULT_COORD, h  || Wx::DEFAULT_COORD)
    end

    def to_point
      x, y = self
      Wx::Point.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
    end

    def to_real_point
      x, y = self
      Wx::RealPoint.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
    end

  end

  # extend standard Array class
  ::Array.include(Wx::ArrayExt)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.rc.2 lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.rc.1 lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.beta.14 lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.beta.13 lib/wx/core/array_ext.rb