Class: Origami::Null

Inherits:
Object
  • Object
show all
Includes:
Object
Defined in:
lib/origami/null.rb,
lib/origami/obfuscation.rb

Overview

Class representing Null Object.

Constant Summary collapse

TOKENS =

:nodoc:

%w{ null }
@@regexp =
Regexp.new(WHITESPACES + TOKENS.first)

Instance Attribute Summary

Attributes included from Object

#file_offset, #generation, #no, #objstm_offset, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Object

#<=>, #cast_to, #copy, #export, #indirect_parent, #is_indirect?, #logicalize, #logicalize!, #native_type, #pdf, #pdf_version_required, #post_build, #pre_build, #reference, #resolve_all_references, #set_indirect, #set_pdf, #size, skip_until_next_obj, #solve, #to_o, #type, typeof, #xrefs

Constructor Details

#initializeNull

Returns a new instance of Null.



42
43
44
# File 'lib/origami/null.rb', line 42

def initialize
  super
end

Class Method Details

.native_typeObject



71
# File 'lib/origami/null.rb', line 71

def self.native_type ; Null end

.parse(stream, parser = nil) ⇒ Object

:nodoc:



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/origami/null.rb', line 46

def self.parse(stream, parser = nil) #:nodoc:

  offset = stream.pos
  
  if stream.skip(@@regexp).nil?
    raise InvalidNullObjectError
  end
  
  null = Null.new
  null.file_offset = offset

  null
end

Instance Method Details

#to_sObject Also known as: to_obfuscated_str

:nodoc:



67
68
69
# File 'lib/origami/null.rb', line 67

def to_s #:nodoc:
  super(TOKENS.first)
end

#valueObject

Returns nil.



63
64
65
# File 'lib/origami/null.rb', line 63

def value
  nil
end