Class: Luoma::StrictUndefinedDrop

Inherits:
UndefinedDrop show all
Defined in:
lib/luoma/drops/undefined.rb,
sig/luoma/drops/undefined.rbs

Overview

An "undefined" type that raises UndefinedVariableError in all contexts.

Direct Known Subclasses

FalsyStrictUndefinedDrop

Instance Method Summary collapse

Methods inherited from UndefinedDrop

#initialize

Methods inherited from Drop

#to_a

Constructor Details

This class inherits a constructor from Luoma::UndefinedDrop

Instance Method Details

#contains?(obj, context) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/luoma/drops/undefined.rb', line 68

def contains?(obj, context)
  error
end

#eachObject



52
53
54
# File 'lib/luoma/drops/undefined.rb', line 52

def each(&)
  error
end

#eq?(obj, context) ⇒ Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/luoma/drops/undefined.rb', line 56

def eq?(obj, context)
  error
end

#errorObject

Returns:

  • (Object)

Raises:



94
95
96
97
98
99
100
101
# File 'lib/luoma/drops/undefined.rb', line 94

def error
  raise UndefinedVariableError.new(
    "#{@path.inspect} is undefined",
    @token,
    @source,
    @template_name
  )
end

#fetch(name, context, default: :nothing) ⇒ Object



48
49
50
# File 'lib/luoma/drops/undefined.rb', line 48

def fetch(name, context, default: :nothing)
  error
end

#gt?(obj, context) ⇒ Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/luoma/drops/undefined.rb', line 64

def gt?(obj, context)
  error
end

#key?(obj, context) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/luoma/drops/undefined.rb', line 44

def key?(obj, context)
  error
end

#length(context) ⇒ Object



72
73
74
# File 'lib/luoma/drops/undefined.rb', line 72

def length(context)
  error
end

#lt?(obj, context) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/luoma/drops/undefined.rb', line 60

def lt?(obj, context)
  error
end

#render(context) ⇒ Object



88
89
90
# File 'lib/luoma/drops/undefined.rb', line 88

def render(context)
  error
end

#slice(start, stop, step) ⇒ Object



76
77
78
# File 'lib/luoma/drops/undefined.rb', line 76

def slice(start, stop, step)
  error
end

#to_primitive(hint, context) ⇒ Object



80
81
82
# File 'lib/luoma/drops/undefined.rb', line 80

def to_primitive(hint, context)
  error
end

#to_sObject



84
85
86
# File 'lib/luoma/drops/undefined.rb', line 84

def to_s
  error
end