Class: Browserbeam::Changes

Inherits:
Struct
  • Object
show all
Defined in:
lib/browserbeam/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#content_changedObject

Returns the value of attribute content_changed

Returns:

  • (Object)

    the current value of content_changed



27
28
29
# File 'lib/browserbeam/types.rb', line 27

def content_changed
  @content_changed
end

#content_deltaObject

Returns the value of attribute content_delta

Returns:

  • (Object)

    the current value of content_delta



27
28
29
# File 'lib/browserbeam/types.rb', line 27

def content_delta
  @content_delta
end

#elements_addedObject

Returns the value of attribute elements_added

Returns:

  • (Object)

    the current value of elements_added



27
28
29
# File 'lib/browserbeam/types.rb', line 27

def elements_added
  @elements_added
end

#elements_removedObject

Returns the value of attribute elements_removed

Returns:

  • (Object)

    the current value of elements_removed



27
28
29
# File 'lib/browserbeam/types.rb', line 27

def elements_removed
  @elements_removed
end

Class Method Details

.from_hash(data) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/browserbeam/types.rb', line 28

def self.from_hash(data)
  return nil unless data.is_a?(Hash)
  new(
    content_changed: data["content_changed"] || false,
    content_delta: data["content_delta"],
    elements_added: data["elements_added"] || [],
    elements_removed: data["elements_removed"] || [],
  )
end