Sha256: 1c02f3794100fe789def8dfa396c146e24dd052d18679b0f6744dd6be6269eb8
Contents?: true
Size: 568 Bytes
Versions: 14
Compression:
Stored size: 568 Bytes
Contents
module Frank module Cucumber class Rect attr_reader :x, :y, :width, :height def self.from_api_repr( hash ) x,y = hash["origin"]["x"], hash["origin"]["y"] width,height = hash["size"]["width"],hash["size"]["height"] self.new( x, y, width, height ) end def initialize(x,y,width,height) @x,@y,@width,@height = x,y,width,height end def center OpenStruct.new( :x => @x.to_f + (@width.to_f/2), :y => @y.to_f + (@height.to_f/2) ) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems