Class: Presenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/present_foo/presenter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, *args) ⇒ Presenter

Returns a new instance of Presenter.



3
4
5
# File 'lib/present_foo/presenter.rb', line 3

def initialize(obj, *args)
  super(obj)
end

Instance Attribute Details

#presenting_objectObject Also known as: controller

Returns the value of attribute presenting_object.



7
8
9
# File 'lib/present_foo/presenter.rb', line 7

def presenting_object
  @presenting_object
end

Class Method Details

.new_list(objs, *args) ⇒ Object



10
11
12
# File 'lib/present_foo/presenter.rb', line 10

def self.new_list(objs, *args)
  objs.map { |o| new(o) }
end

Instance Method Details

#classObject



18
19
20
# File 'lib/present_foo/presenter.rb', line 18

def class
  obj.class
end

#objObject



14
15
16
# File 'lib/present_foo/presenter.rb', line 14

def obj
  __getobj__
end