Class: Dry::View::NullPart

Inherits:
ValuePart show all
Defined in:
lib/dry/view/null_part.rb

Instance Attribute Summary

Attributes inherited from ValuePart

#_data, #_value

Attributes inherited from Part

#renderer

Instance Method Summary collapse

Methods inherited from ValuePart

#initialize, #to_s

Methods inherited from Part

#initialize, #render, #template?

Constructor Details

This class inherits a constructor from Dry::View::ValuePart

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object (private)



19
20
21
22
23
24
25
26
27
# File 'lib/dry/view/null_part.rb', line 19

def method_missing(meth, *args, &block)
  template_path = template?("#{meth}_missing")

  if template_path
    render(template_path)
  else
    nil
  end
end

Instance Method Details

#[](key) ⇒ Object



7
8
# File 'lib/dry/view/null_part.rb', line 7

def [](key)
end

#each(&block) ⇒ Object



10
11
# File 'lib/dry/view/null_part.rb', line 10

def each(&block)
end

#respond_to_missing?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/dry/view/null_part.rb', line 13

def respond_to_missing?(*)
  true
end