Class: Browserbeam::ScrollState
- Inherits:
-
Struct
- Object
- Struct
- Browserbeam::ScrollState
- Defined in:
- lib/browserbeam/types.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#percent ⇒ Object
Returns the value of attribute percent.
-
#viewport ⇒ Object
Returns the value of attribute viewport.
-
#y ⇒ Object
Returns the value of attribute y.
Class Method Summary collapse
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height
39 40 41 |
# File 'lib/browserbeam/types.rb', line 39 def height @height end |
#percent ⇒ Object
Returns the value of attribute percent
39 40 41 |
# File 'lib/browserbeam/types.rb', line 39 def percent @percent end |
#viewport ⇒ Object
Returns the value of attribute viewport
39 40 41 |
# File 'lib/browserbeam/types.rb', line 39 def @viewport end |
#y ⇒ Object
Returns the value of attribute y
39 40 41 |
# File 'lib/browserbeam/types.rb', line 39 def y @y end |
Class Method Details
.from_hash(data) ⇒ Object
40 41 42 43 |
# File 'lib/browserbeam/types.rb', line 40 def self.from_hash(data) return nil unless data.is_a?(Hash) new(y: data["y"] || 0, height: data["height"] || 0, viewport: data["viewport"] || 0, percent: data["percent"] || 0) end |