Class: Luoma::Drop

Inherits:
Object
  • Object
show all
Includes:
Enumerable, Enumerable[untyped]
Defined in:
lib/luoma/drop.rb,
sig/luoma/drop.rbs

Instance Method Summary collapse

Instance Method Details

#contains?(obj, context) ⇒ Boolean

(untyped, RenderContext) -> bool

Parameters:

Returns:

  • (Boolean)


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

Parameters:

Returns:

  • (Boolean)


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

Parameters:

Returns:

  • (Object)


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

Parameters:

Returns:

  • (Boolean)


38
39
40
# File 'lib/luoma/drop.rb', line 38

def gt?(obj, context)
  false
end

#key?(obj, context) ⇒ Boolean

(untyped, RenderContext) -> bool

Parameters:

Returns:

  • (Boolean)


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

Parameters:

Returns:

  • (Integer)


50
51
52
# File 'lib/luoma/drop.rb', line 50

def length(context)
  0
end

#lt?(obj, context) ⇒ Boolean

(untyped, RenderContext) -> bool

Parameters:

Returns:

  • (Boolean)


33
34
35
# File 'lib/luoma/drop.rb', line 33

def lt?(obj, context)
  false
end

#render(context) ⇒ String?

(RenderContext) -> String?

Parameters:

Returns:

  • (String, nil)


79
80
81
# File 'lib/luoma/drop.rb', line 79

def render(context)
  nil
end

#slice(start, stop, step, context) ⇒ Object

(Integer, Integer, Integer, RenderContext) -> Enumerable

Parameters:

  • start (Integer)
  • stop (Integer)
  • step (Integer)
  • context (RenderContext)

Returns:

  • (Object)


55
56
57
# File 'lib/luoma/drop.rb', line 55

def slice(start, stop, step, context)
  self
end

#to_aArray[untyped]

Returns:

  • (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

Parameters:

Returns:

  • (Object)


60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/luoma/drop.rb', line 60

def to_primitive(hint, context)
  case hint
  when :data
    nil
  when :numeric
    0
  when :string
    ""
  when :boolean
    false
  end
end

#to_sString

() -> String

Returns:

  • (String)


74
75
76
# File 'lib/luoma/drop.rb', line 74

def to_s
  ""
end