Class: Browserbeam::PageState
- Inherits:
-
Struct
- Object
- Struct
- Browserbeam::PageState
- Defined in:
- lib/browserbeam/types.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
Returns the value of attribute changes.
-
#forms ⇒ Object
Returns the value of attribute forms.
-
#interactive_elements ⇒ Object
Returns the value of attribute interactive_elements.
-
#map ⇒ Object
Returns the value of attribute map.
-
#markdown ⇒ Object
Returns the value of attribute markdown.
-
#scroll ⇒ Object
Returns the value of attribute scroll.
-
#stable ⇒ Object
Returns the value of attribute stable.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Attribute Details
#changes ⇒ Object
Returns the value of attribute changes
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def changes @changes end |
#forms ⇒ Object
Returns the value of attribute forms
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def forms @forms end |
#interactive_elements ⇒ Object
Returns the value of attribute interactive_elements
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def interactive_elements @interactive_elements end |
#map ⇒ Object
Returns the value of attribute map
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def map @map end |
#markdown ⇒ Object
Returns the value of attribute markdown
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def markdown @markdown end |
#scroll ⇒ Object
Returns the value of attribute scroll
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def scroll @scroll end |
#stable ⇒ Object
Returns the value of attribute stable
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def stable @stable end |
#title ⇒ Object
Returns the value of attribute title
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def title @title end |
#url ⇒ Object
Returns the value of attribute url
46 47 48 |
# File 'lib/browserbeam/types.rb', line 46 def url @url end |
Class Method Details
.from_hash(data) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/browserbeam/types.rb', line 47 def self.from_hash(data) return nil unless data.is_a?(Hash) new( url: data["url"] || "", title: data["title"] || "", stable: data["stable"] || false, markdown: MarkdownContent.from_hash(data["markdown"]), map: data["map"] ? data["map"].map { |m| MapEntry.from_hash(m) } : nil, interactive_elements: (data["interactive_elements"] || []).map { |el| InteractiveElement.from_hash(el) }, forms: data["forms"] || [], changes: Changes.from_hash(data["changes"]), scroll: ScrollState.from_hash(data["scroll"]), ) end |