Class: Serega::SeregaPlugins::Presenter::Presenter

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
Forwardable, Serega::SeregaHelpers::SerializerClassHelper
Includes:
InstanceMethods
Defined in:
lib/serega/plugins/presenter/presenter.rb

Overview

Presenter class

Defined Under Namespace

Modules: InstanceMethods

Instance Attribute Summary

Attributes included from Serega::SeregaHelpers::SerializerClassHelper

#serializer_class

Class Method Summary collapse

Methods included from InstanceMethods

#initialize

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Serega::SeregaPlugins::Presenter::Presenter::InstanceMethods

Class Method Details

.include(*modules) ⇒ void

This method returns an undefined value.

Marks the class as modified, then includes the module



138
139
140
141
# File 'lib/serega/plugins/presenter/presenter.rb', line 138

def include(*modules)
  @modified = true
  super
end

.modified?Boolean

Checks if this Presenter class (or an inherited one) was extended with custom user code and therefore objects must be wrapped

Returns:

  • (Boolean)

    whether custom presenter methods were defined



129
130
131
132
133
134
# File 'lib/serega/plugins/presenter/presenter.rb', line 129

def modified?
  return true if defined?(@modified)
  return false if equal?(Presenter) # the plugin's base class — the walk stops here

  superclass.modified?
end

.prepend(*modules) ⇒ void

This method returns an undefined value.

Marks the class as modified, then prepends the module



145
146
147
148
# File 'lib/serega/plugins/presenter/presenter.rb', line 145

def prepend(*modules)
  @modified = true
  super
end