Class: CaptureOptions
- Inherits:
-
Object
- Object
- CaptureOptions
- Defined in:
- lib/wraith/helpers/capture_options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#wraith ⇒ Object
readonly
Returns the value of attribute wraith.
Instance Method Summary collapse
- #base_url ⇒ Object
- #base_urls(path) ⇒ Object
- #before_capture ⇒ Object
- #casper?(options) ⇒ Boolean
- #compare_url ⇒ Object
- #compare_urls(path) ⇒ Object
-
#initialize(options, wraith) ⇒ CaptureOptions
constructor
A new instance of CaptureOptions.
- #path ⇒ Object
- #resize ⇒ Object
- #selector ⇒ Object
Constructor Details
#initialize(options, wraith) ⇒ CaptureOptions
Returns a new instance of CaptureOptions.
7 8 9 10 |
# File 'lib/wraith/helpers/capture_options.rb', line 7 def initialize(, wraith) @options = @wraith = wraith end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/wraith/helpers/capture_options.rb', line 5 def @options end |
#wraith ⇒ Object (readonly)
Returns the value of attribute wraith.
5 6 7 |
# File 'lib/wraith/helpers/capture_options.rb', line 5 def wraith @wraith end |
Instance Method Details
#base_url ⇒ Object
33 34 35 |
# File 'lib/wraith/helpers/capture_options.rb', line 33 def base_url base_urls(path) end |
#base_urls(path) ⇒ Object
41 42 43 |
# File 'lib/wraith/helpers/capture_options.rb', line 41 def base_urls(path) wraith.base_domain + path unless wraith.base_domain.nil? end |
#before_capture ⇒ Object
29 30 31 |
# File 'lib/wraith/helpers/capture_options.rb', line 29 def before_capture ["before_capture"] ? convert_to_absolute(["before_capture"]) : false end |
#casper?(options) ⇒ Boolean
49 50 51 |
# File 'lib/wraith/helpers/capture_options.rb', line 49 def casper?() ["path"] ? ["path"] : end |
#compare_url ⇒ Object
37 38 39 |
# File 'lib/wraith/helpers/capture_options.rb', line 37 def compare_url compare_urls(path) end |
#compare_urls(path) ⇒ Object
45 46 47 |
# File 'lib/wraith/helpers/capture_options.rb', line 45 def compare_urls(path) wraith.comp_domain + path unless wraith.comp_domain.nil? end |
#path ⇒ Object
12 13 14 |
# File 'lib/wraith/helpers/capture_options.rb', line 12 def path casper?() end |
#resize ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/wraith/helpers/capture_options.rb', line 20 def resize # path level, or YAML-file level `resize_or_reload` property value if ["resize_or_reload"] (["resize_or_reload"] == "resize") else wraith.resize end end |
#selector ⇒ Object
16 17 18 |
# File 'lib/wraith/helpers/capture_options.rb', line 16 def selector ["selector"] || "body" end |