Class: Unmagic::Browser::Console::Document

Inherits:
Tagged
  • Object
show all
Defined in:
lib/unmagic/browser/console/values.rb

Overview

Bytes there's no way to draw in a terminal — a PDF. Saved and pointed at.

Instance Attribute Summary collapse

Attributes inherited from Tagged

#name

Instance Method Summary collapse

Constructor Details

#initialize(value, extension: "pdf", name: "document") ⇒ Document

Returns a new instance of Document.

Parameters:

  • value (String)

    the bytes

  • extension (String) (defaults to: "pdf")

    the file extension to save under

  • name (String) (defaults to: "document")

    a filename stem for the copy written to disk



68
69
70
71
# File 'lib/unmagic/browser/console/values.rb', line 68

def initialize(value, extension: "pdf", name: "document")
  super(value, name: name)
  @extension = extension
end

Instance Attribute Details

#extensionString (readonly)

Returns the file extension for the copy written to disk.

Returns:

  • (String)

    the file extension for the copy written to disk



74
75
76
# File 'lib/unmagic/browser/console/values.rb', line 74

def extension
  @extension
end