Class: Browserbeam::SessionEnvelope

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#blockers_dismissedObject

Returns the value of attribute blockers_dismissed

Returns:

  • (Object)

    the current value of blockers_dismissed



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def blockers_dismissed
  @blockers_dismissed
end

#completedObject

Returns the value of attribute completed

Returns:

  • (Object)

    the current value of completed



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def completed
  @completed
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def error
  @error
end

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def expires_at
  @expires_at
end

#extractionObject

Returns the value of attribute extraction

Returns:

  • (Object)

    the current value of extraction



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def extraction
  @extraction
end

#mediaObject

Returns the value of attribute media

Returns:

  • (Object)

    the current value of media



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def media
  @media
end

#pageObject

Returns the value of attribute page

Returns:

  • (Object)

    the current value of page



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def page
  @page
end

#request_idObject

Returns the value of attribute request_id

Returns:

  • (Object)

    the current value of request_id



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def request_id
  @request_id
end

#session_idObject

Returns the value of attribute session_id

Returns:

  • (Object)

    the current value of session_id



82
83
84
# File 'lib/browserbeam/types.rb', line 82

def session_id
  @session_id
end

Class Method Details

.from_hash(data) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/browserbeam/types.rb', line 83

def self.from_hash(data)
  new(
    session_id: data["session_id"] || "",
    expires_at: data["expires_at"] || "",
    request_id: data["request_id"] || "",
    completed: data["completed"] || 0,
    page: PageState.from_hash(data["page"]),
    media: (data["media"] || []).map { |m| MediaItem.from_hash(m) },
    extraction: data["extraction"],
    blockers_dismissed: data["blockers_dismissed"] || [],
    error: StepError.from_hash(data["error"]),
  )
end