Class: Luoma::UndefinedDrop
- Defined in:
- lib/luoma/drops/undefined.rb,
sig/luoma/drops/undefined.rbs
Overview
The default and base "undefined" type.
Direct Known Subclasses
Instance Method Summary collapse
-
#eq?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
- #fetch(name, context, default: :nothing) ⇒ Object
-
#initialize(path, token, source, template_name) ⇒ UndefinedDrop
constructor
(String, t_token, String, String) -> void.
- #to_primitive(hint, context) ⇒ Object
Methods inherited from Drop
#contains?, #each, #gt?, #key?, #length, #lt?, #render, #slice, #to_a, #to_s
Constructor Details
#initialize(path, token, source, template_name) ⇒ UndefinedDrop
(String, t_token, String, String) -> void
9 10 11 12 13 14 15 |
# File 'lib/luoma/drops/undefined.rb', line 9 def initialize(path, token, source, template_name) super() @path = path @token = token @source = source @template_name = template_name end |
Instance Method Details
#eq?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
23 24 25 |
# File 'lib/luoma/drops/undefined.rb', line 23 def eq?(obj, context) obj.is_a?(UndefinedDrop) end |
#fetch(name, context, default: :nothing) ⇒ Object
18 19 20 |
# File 'lib/luoma/drops/undefined.rb', line 18 def fetch(name, context, default: :nothing) self end |
#to_primitive(hint, context) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/luoma/drops/undefined.rb', line 28 def to_primitive(hint, context) case hint when :data nil when :numeric :nothing when :string "" when :boolean false end end |