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, #numbered?, #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
51
# File 'lib/origami/null.rb', line 39

def self.parse(stream, _parser = nil) #:nodoc:
    scanner = Parser.init_scanner(stream)
    offset = scanner.pos

    if scanner.skip(@@regexp).nil?
        raise InvalidNullObjectError
    end

    null = Null.new
    null.file_offset = offset

    null
end

Instance Method Details

#to_s(eol: $/) ⇒ Object Also known as: to_obfuscated_str

:nodoc:



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

def to_s(eol: $/) #:nodoc:
    super(TOKENS.first, eol: eol)
end

#valueObject

Returns nil.



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

def value
    nil
end