Class: Percept::CheckboxField

Inherits:
Object
  • Object
show all
Defined in:
lib/percept/checkbox_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ CheckboxField

Returns a new instance of CheckboxField.



7
8
9
10
11
12
# File 'lib/percept/checkbox_field.rb', line 7

def initialize(params)
  self.start_x = params.fetch(:start_x)
  self.start_y = params.fetch(:start_y)
  self.end_x = params.fetch(:end_x)
  self.end_y = params.fetch(:end_y)
end

Instance Attribute Details

#end_xObject

Returns the value of attribute end_x.



5
6
7
# File 'lib/percept/checkbox_field.rb', line 5

def end_x
  @end_x
end

#end_yObject

Returns the value of attribute end_y.



5
6
7
# File 'lib/percept/checkbox_field.rb', line 5

def end_y
  @end_y
end

#start_xObject

Returns the value of attribute start_x.



5
6
7
# File 'lib/percept/checkbox_field.rb', line 5

def start_x
  @start_x
end

#start_yObject

Returns the value of attribute start_y.



5
6
7
# File 'lib/percept/checkbox_field.rb', line 5

def start_y
  @start_y
end

Instance Method Details

#heightObject



18
19
20
# File 'lib/percept/checkbox_field.rb', line 18

def height
  end_y - start_y
end

#widthObject



14
15
16
# File 'lib/percept/checkbox_field.rb', line 14

def width
  end_x - start_x
end