Class: Compendium::Presenters::Base

Inherits:
Object
  • Object
show all
Defined in:
app/classes/compendium/presenters/base.rb

Direct Known Subclasses

Metric, Option, Query

Instance Method Summary collapse

Constructor Details

#initialize(template, object) ⇒ Base

Returns a new instance of Base.



3
4
5
6
# File 'app/classes/compendium/presenters/base.rb', line 3

def initialize(template, object)
  @object = object
  @template = template
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



20
21
22
23
# File 'app/classes/compendium/presenters/base.rb', line 20

def method_missing(*args, &block)
  return @template.send(*args, &block) if @template.respond_to?(args.first)
  super
end

Instance Method Details

#to_sObject



8
9
10
# File 'app/classes/compendium/presenters/base.rb', line 8

def to_s
  "#<#{self.class.name}:0x00#{'%x' % (object_id << 1)}>"
end