Class: DiningTable::Presenters::Presenter

Inherits:
Object
  • Object
show all
Defined in:
lib/dining-table/presenters/presenter.rb

Direct Known Subclasses

HTMLPresenter, SpreadsheetPresenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Presenter

Returns a new instance of Presenter.



9
10
11
# File 'lib/dining-table/presenters/presenter.rb', line 9

def initialize( options = {} )
  self.options = default_options.merge( options )
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/dining-table/presenters/presenter.rb', line 7

def options
  @options
end

#tableObject

Returns the value of attribute table.



7
8
9
# File 'lib/dining-table/presenters/presenter.rb', line 7

def table
  @table
end

#view_contextObject

Returns the value of attribute view_context.



7
8
9
# File 'lib/dining-table/presenters/presenter.rb', line 7

def view_context
  @view_context
end

Instance Method Details

#connect_to(table) ⇒ Object



13
14
15
# File 'lib/dining-table/presenters/presenter.rb', line 13

def connect_to( table )
  self.table = table
end

#identifierObject

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/dining-table/presenters/presenter.rb', line 17

def identifier
  raise NotImplementedError
end

#type?(identifier_) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dining-table/presenters/presenter.rb', line 21

def type?( identifier_ )
  identifier == identifier_
end