Sha256: bbf47a6e74ff18bae9241d6335426db39e5728e3a1828bd9c012ca9a7e1423ca
Contents?: true
Size: 661 Bytes
Versions: 11
Compression:
Stored size: 661 Bytes
Contents
# frozen_string_literal: true # lib/region.rb module Percy class Region attr_accessor :top, :bottom, :left, :right def initialize(top, bottom, left, right) raise ArgumentError, 'Only Positive integer is allowed!' if [top, bottom, left, right].any?(&:negative?) raise ArgumentError, 'Invalid ignore region parameters!' if top >= bottom || left >= right @top = top @bottom = bottom @left = left @right = right end def valid?(screen_height, screen_width) return false if @top >= screen_height || @bottom > screen_height || @left >= screen_width || @right > screen_width true end end end
Version data entries
11 entries across 11 versions & 1 rubygems