Sha256: a6a19a2eb62d4eb4444107f67789d7c215ccc0f9bac6acc6584e1665f93a4d3d

Contents?: true

Size: 615 Bytes

Versions: 10

Compression:

Stored size: 615 Bytes

Contents

require_relative "vertical"

module Fidgit
  # Main container that can contains a single "proper" packing element.
  class MainPacker < Vertical
    def initialize(options = {})
      options = {
          width: $window.width,
          height: $window.height,
      }.merge! options

      super options
    end

    def width; $window.width; end
    def height; $window.height; end
    def width=(value); ; end
    def height=(value); ; end

    def add(element)
      raise "MainPacker can only contain packing elements" unless element.is_a? Packer
      super(element)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fidgit-0.2.4 lib/fidgit/elements/main_packer.rb
fidgit-0.2.3 lib/fidgit/elements/main_packer.rb
fidgit-0.2.2 lib/fidgit/elements/main_packer.rb
fidgit-0.2.1 lib/fidgit/elements/main_packer.rb
fidgit-0.2.0 lib/fidgit/elements/main_packer.rb
fidgit-0.1.10 lib/fidgit/elements/main_packer.rb
fidgit-0.1.9 lib/fidgit/elements/main_packer.rb
fidgit-0.1.8 lib/fidgit/elements/main_packer.rb
fidgit-0.1.7 lib/fidgit/elements/main_packer.rb
fidgit-0.1.6 lib/fidgit/elements/main_packer.rb