Class: Liquid2::StrictUndefined
Overview
An undefined type that always raises an exception.
Instance Attribute Summary
Attributes inherited from Undefined
#force_default
Instance Method Summary
collapse
Constructor Details
#initialize(name, node: nil) ⇒ StrictUndefined
42
43
44
45
|
# File 'lib/liquid2/undefined.rb', line 42
def initialize(name, node: nil)
super
@message = "#{@node.is_a?(Path) ? @node : name.inspect} is undefined"
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
49
50
51
|
# File 'lib/liquid2/undefined.rb', line 49
def method_missing(...)
raise UndefinedError.new(@message, @node.token)
end
|
Instance Method Details
#! ⇒ Object
73
74
75
|
# File 'lib/liquid2/undefined.rb', line 73
def !
raise UndefinedError.new(@message, @node.token)
end
|
#!=(_other) ⇒ Object
81
82
83
|
# File 'lib/liquid2/undefined.rb', line 81
def !=(_other)
raise UndefinedError.new(@message, @node.token)
end
|
#+@ ⇒ Object
107
108
109
|
# File 'lib/liquid2/undefined.rb', line 107
def +@
self
end
|
#-@ ⇒ Object
111
112
113
|
# File 'lib/liquid2/undefined.rb', line 111
def -@
self
end
|
#==(_other) ⇒ Object
Also known as:
eql?
77
78
79
|
# File 'lib/liquid2/undefined.rb', line 77
def ==(_other)
raise UndefinedError.new(@message, @node.token)
end
|
#[] ⇒ Object
53
54
55
|
# File 'lib/liquid2/undefined.rb', line 53
def [](...)
raise UndefinedError.new(@message, @node.token)
end
|
#each ⇒ Object
115
116
117
|
# File 'lib/liquid2/undefined.rb', line 115
def each(...)
raise UndefinedError.new(@message, @node.token)
end
|
#each_with_index ⇒ Object
119
120
121
|
# File 'lib/liquid2/undefined.rb', line 119
def each_with_index(...)
raise UndefinedError.new(@message, @node.token)
end
|
#fetch ⇒ Object
69
70
71
|
# File 'lib/liquid2/undefined.rb', line 69
def fetch(...)
raise UndefinedError.new(@message, @node.token)
end
|
#include? ⇒ Boolean
61
62
63
|
# File 'lib/liquid2/undefined.rb', line 61
def include?(...)
raise UndefinedError.new(@message, @node.token)
end
|
#join ⇒ Object
123
124
125
|
# File 'lib/liquid2/undefined.rb', line 123
def join(...)
raise UndefinedError.new(@message, @node.token)
end
|
#key? ⇒ Boolean
57
58
59
|
# File 'lib/liquid2/undefined.rb', line 57
def key?(...)
raise UndefinedError.new(@message, @node.token)
end
|
#length ⇒ Object
91
92
93
|
# File 'lib/liquid2/undefined.rb', line 91
def length
raise UndefinedError.new(@message, @node.token)
end
|
#member? ⇒ Boolean
65
66
67
|
# File 'lib/liquid2/undefined.rb', line 65
def member?(...)
raise UndefinedError.new(@message, @node.token)
end
|
#poke ⇒ Object
131
132
133
|
# File 'lib/liquid2/undefined.rb', line 131
def poke
raise UndefinedError.new(@message, @node.token)
end
|
#respond_to_missing? ⇒ Boolean
47
|
# File 'lib/liquid2/undefined.rb', line 47
def respond_to_missing? = true
|
#size ⇒ Object
87
88
89
|
# File 'lib/liquid2/undefined.rb', line 87
def size
raise UndefinedError.new(@message, @node.token)
end
|
#to_f ⇒ Object
103
104
105
|
# File 'lib/liquid2/undefined.rb', line 103
def to_f
raise UndefinedError.new(@message, @node.token)
end
|
#to_i ⇒ Object
99
100
101
|
# File 'lib/liquid2/undefined.rb', line 99
def to_i
raise UndefinedError.new(@message, @node.token)
end
|
#to_liquid(_context) ⇒ Object
127
128
129
|
# File 'lib/liquid2/undefined.rb', line 127
def to_liquid(_context)
self
end
|
#to_s ⇒ Object
95
96
97
|
# File 'lib/liquid2/undefined.rb', line 95
def to_s
raise UndefinedError.new(@message, @node.token)
end
|