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, #document, #export, included, #indirect?, #indirect_parent, #logicalize, #logicalize!, #native_type, #post_build, #pre_build, #reference, #set_document, #set_indirect, skip_until_next_obj, #solve, #to_o, #type, typeof, #version_required, #xrefs

Constructor Details

#initializeNull

Returns a new instance of Null.



35
36
37
# File 'lib/origami/null.rb', line 35

def initialize
    super
end

Class Method Details

.parse(stream, _parser = nil) ⇒ Object

:nodoc:



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/origami/null.rb', line 39

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:



59
60
61
# File 'lib/origami/null.rb', line 59

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

#valueObject

Returns nil.



55
56
57
# File 'lib/origami/null.rb', line 55

def value
    nil
end