Class: Applitools::Selenium::RGridDom
- Inherits:
-
Object
- Object
- Applitools::Selenium::RGridDom
- Includes:
- Jsonable
- Defined in:
- lib/applitools/selenium/rgrid_dom.rb
Constant Summary collapse
- CONTENT_TYPE =
'x-applitools-html/cdt'.freeze
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#dom_nodes ⇒ Object
Returns the value of attribute dom_nodes.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #calculate_sha_256 ⇒ Object
- #content ⇒ Object
-
#initialize(*args) ⇒ RGridDom
constructor
A new instance of RGridDom.
- #resource ⇒ Object
Constructor Details
#initialize(*args) ⇒ RGridDom
Returns a new instance of RGridDom.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 10 def initialize(*args) = Applitools::Utils. args self.url = [:url] self.dom_nodes = [:dom_nodes] self.resources = [:resources] self.hash_format = 'sha256' self.data = { 'resources' => resources, 'domNodes' => dom_nodes } self.hash = calculate_sha_256 end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 8 def data @data end |
#dom_nodes ⇒ Object
Returns the value of attribute dom_nodes.
8 9 10 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 8 def dom_nodes @dom_nodes end |
#resources ⇒ Object
Returns the value of attribute resources.
8 9 10 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 8 def resources @resources end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 8 def url @url end |
Instance Method Details
#calculate_sha_256 ⇒ Object
23 24 25 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 23 def calculate_sha_256 Digest::SHA256.hexdigest(content) end |
#content ⇒ Object
27 28 29 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 27 def content Oj.dump(json_value(data.sort.to_h)) end |
#resource ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/applitools/selenium/rgrid_dom.rb', line 31 def resource Applitools::Selenium::VGResource.new( url, CONTENT_TYPE, content ) end |