Class: Restet::Client::ExtractionParams

Inherits:
Object
  • Object
show all
Defined in:
lib/restet/client/extraction_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, slices = {}) ⇒ ExtractionParams

Returns a new instance of ExtractionParams.



6
7
8
# File 'lib/restet/client/extraction_params.rb', line 6

def initialize(file, slices = {})
  @file, @slices = file, slices
end

Instance Attribute Details

#file ⇒ Object (readonly)

Returns the value of attribute file.



4
5
6
# File 'lib/restet/client/extraction_params.rb', line 4

def file
  @file
end

#slices ⇒ Object (readonly)

Returns the value of attribute slices.



4
5
6
# File 'lib/restet/client/extraction_params.rb', line 4

def slices
  @slices
end

Instance Method Details

#slice(name, bottom_left, top_right) ⇒ Object



10
11
12
# File 'lib/restet/client/extraction_params.rb', line 10

def slice(name, bottom_left, top_right)
  @slices[name.to_sym] = {:bottom_left => bottom_left, :top_right => top_right}
end

#to_json ⇒ Object



14
15
16
# File 'lib/restet/client/extraction_params.rb', line 14

def to_json
  JSON.dump(@slices)
end