class ExportTo::Presenter

Constants

NoAttributeError

Attributes

model[RW]
relation[RW]
x[RW]
y[RW]

Public Class Methods

new(model, relation=nil, x, y) click to toggle source
# File lib/export_to/presenter.rb, line 6
def initialize(model, relation=nil, x, y)
  self.model, self.relation = model, relation
  self.x, self.y = x, y
end

Public Instance Methods

method_missing(m, *args, &block) click to toggle source
# File lib/export_to/presenter.rb, line 15
def method_missing(m, *args, &block)
  obj = relation.respond_to?(m) ? relation : model
  if block_given?
    obj.public_send(m, *args, &block)
  else
    obj.public_send(m, *args)
  end
end
relation?() click to toggle source
# File lib/export_to/presenter.rb, line 11
def relation?
  relation.present?
end