Class: Restet::Client::ExtractionParams
- Inherits:
-
Object
- Object
- Restet::Client::ExtractionParams
- Defined in:
- lib/restet/client/extraction_params.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#slices ⇒ Object
readonly
Returns the value of attribute slices.
Instance Method Summary collapse
-
#initialize(file, slices = {}) ⇒ ExtractionParams
constructor
A new instance of ExtractionParams.
- #slice(name, bottom_left, top_right) ⇒ Object
- #to_json ⇒ Object
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 |