Module: Railjet::Presenter::Factory::ClassMethods

Defined in:
lib/railjet/presenter.rb

Instance Method Summary collapse

Instance Method Details

#present(object) ⇒ Object



86
87
88
# File 'lib/railjet/presenter.rb', line 86

def present(object)
  presenter_class(object).new(object)
end

#present_collection(objects) ⇒ Object



82
83
84
# File 'lib/railjet/presenter.rb', line 82

def present_collection(objects)
  objects.map { |o| present(o) }
end

#presenter_class(object) ⇒ Object

Raises:

  • (NotImplementedError)


90
91
92
# File 'lib/railjet/presenter.rb', line 90

def presenter_class(object)
  raise NotImplementedError
end