Class: Pdfrb::Model::Type::WebCaptureCommand

Inherits:
Cos::Dictionary show all
Defined in:
lib/pdfrb/model/type/web_capture_command.rb

Overview

WebCaptureCommand (ISO 32000-1 §14.10.4, PDF 1.3, deprecated PDF 2.0). Describes a URL retrieval for the Web Capture (spider) system: what to fetch, how to fetch it, and what form data to post.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#content_typeObject

/CT — optional content type of posted data (RFC 2045).



30
31
32
# File 'lib/pdfrb/model/type/web_capture_command.rb', line 30

def content_type
  value[:CT] || "application/x-www-form-urlencoded"
end

#delay_secondsObject

/L — optional integer, delay before retrieval in seconds (default 1). Must be >= 1.



20
21
22
# File 'lib/pdfrb/model/type/web_capture_command.rb', line 20

def delay_seconds
  value[:L] || 1
end

#flagsObject

/F — optional bitmask of flags.



25
26
27
# File 'lib/pdfrb/model/type/web_capture_command.rb', line 25

def flags
  value[:F] || 0
end

#settings(document = nil) ⇒ Object

/S — optional WebCaptureCommandSettings dict.



35
36
37
38
39
40
41
42
43
# File 'lib/pdfrb/model/type/web_capture_command.rb', line 35

def settings(document = nil)
  ref = value[:S]
  return nil unless ref && document

  resolved = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
  return nil unless resolved

  Pdfrb::Model::Type::WebCaptureCommandSettings.new(resolved.value)
end

#urlObject

/URL — required ASCII string to retrieve.



14
15
16
# File 'lib/pdfrb/model/type/web_capture_command.rb', line 14

def url
  value[:URL]
end