Class: Luoma::Drop
- Inherits:
-
Object
- Object
- Luoma::Drop
- Includes:
- Enumerable, Enumerable[untyped]
- Defined in:
- lib/luoma/drop.rb,
sig/luoma/drop.rbs
Direct Known Subclasses
BlockDrop, ExpressionDrop, HTMLSafe, RangeDrop, UndefinedDrop
Instance Method Summary collapse
-
#contains?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
- #each(&block) ⇒ void
-
#eq?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
-
#fetch(name, context, default: :nothing) ⇒ Object
(String, RenderContext) -> untyped.
-
#gt?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
-
#key?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
-
#length(context) ⇒ Integer
Return the length of this object.
-
#lt?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool.
-
#render(context) ⇒ String?
(RenderContext) -> String?.
-
#slice(start, stop, step) ⇒ Object
(Integer, Integer, Integer) -> Enumerable.
- #to_a ⇒ Array[untyped]
-
#to_primitive(hint, context) ⇒ Object
(:data | :numeric | :string | :boolean, RenderContext) -> untyped.
-
#to_s ⇒ String
() -> String.
Instance Method Details
#contains?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
43 44 45 |
# File 'lib/luoma/drop.rb', line 43 def contains?(obj, context) false end |
#each(&block) ⇒ void
This method returns an undefined value.
17 18 19 20 21 |
# File 'lib/luoma/drop.rb', line 17 def each(&block) return enum_for(:each) unless block [].to_enum # steep:ignore end |
#eq?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
28 29 30 |
# File 'lib/luoma/drop.rb', line 28 def eq?(obj, context) false end |
#fetch(name, context, default: :nothing) ⇒ Object
(String, RenderContext) -> untyped
13 14 15 |
# File 'lib/luoma/drop.rb', line 13 def fetch(name, context, default: :nothing) default end |
#gt?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
38 39 40 |
# File 'lib/luoma/drop.rb', line 38 def gt?(obj, context) false end |
#key?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
8 9 10 |
# File 'lib/luoma/drop.rb', line 8 def key?(obj, context) false end |
#length(context) ⇒ Integer
Return the length of this object.
Along with #slice, #length is part of the iterator protocol.
(RenderContext) -> Integer
50 51 52 |
# File 'lib/luoma/drop.rb', line 50 def length(context) 0 end |
#lt?(obj, context) ⇒ Boolean
(untyped, RenderContext) -> bool
33 34 35 |
# File 'lib/luoma/drop.rb', line 33 def lt?(obj, context) false end |
#render(context) ⇒ String?
(RenderContext) -> String?
80 81 82 |
# File 'lib/luoma/drop.rb', line 80 def render(context) nil end |
#slice(start, stop, step) ⇒ Object
(Integer, Integer, Integer) -> Enumerable
56 57 58 |
# File 'lib/luoma/drop.rb', line 56 def slice(start, stop, step) self end |
#to_a ⇒ Array[untyped]
23 24 25 |
# File 'lib/luoma/drop.rb', line 23 def to_a each.to_a end |
#to_primitive(hint, context) ⇒ Object
(:data | :numeric | :string | :boolean, RenderContext) -> untyped
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/luoma/drop.rb', line 61 def to_primitive(hint, context) case hint when :data nil when :numeric 0 when :string "" when :boolean false end end |
#to_s ⇒ String
() -> String
75 76 77 |
# File 'lib/luoma/drop.rb', line 75 def to_s "" end |