Class: Hanami::View::Rendering::NullLocal

Inherits:
Utils::BasicObject
Defined in:
lib/hanami/view/rendering/null_local.rb

Overview

Null local

See Also:

  • #local

Since:

  • 0.7.0

Constant Summary collapse

TO_STR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0

"".freeze

Instance Method Summary collapse

Constructor Details

#initialize(local) ⇒ NullLocal

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of NullLocal.

Since:

  • 0.7.0



18
19
20
# File 'lib/hanami/view/rendering/null_local.rb', line 18

def initialize(local)
  @local = local
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0



58
59
60
61
62
63
64
# File 'lib/hanami/view/rendering/null_local.rb', line 58

def method_missing(m, *)
  if m.match(/\?\z/)
    false
  else
    self.class.new("#{ @local }.#{ m }")
  end
end

Instance Method Details

#all?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.7.0



24
25
26
# File 'lib/hanami/view/rendering/null_local.rb', line 24

def all?
  false
end

#any?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.7.0



30
31
32
# File 'lib/hanami/view/rendering/null_local.rb', line 30

def any?
  false
end

#empty?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.7.0



36
37
38
# File 'lib/hanami/view/rendering/null_local.rb', line 36

def empty?
  true
end

#nil?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.7.0



42
43
44
# File 'lib/hanami/view/rendering/null_local.rb', line 42

def nil?
  true
end

#to_strObject Also known as: to_s

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0



48
49
50
# File 'lib/hanami/view/rendering/null_local.rb', line 48

def to_str
  TO_STR
end