Class: Expo2::Asider

Inherits:
Struct
  • Object
show all
Defined in:
lib/expo2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key_mapObject

Returns the value of attribute key_map

Returns:

  • (Object)

    the current value of key_map



42
43
44
# File 'lib/expo2.rb', line 42

def key_map
  @key_map
end

#presenterObject

Returns the value of attribute presenter

Returns:

  • (Object)

    the current value of presenter



42
43
44
# File 'lib/expo2.rb', line 42

def presenter
  @presenter
end

Instance Method Details

#go(object, context, index = nil) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/expo2.rb', line 43

def go(object, context, index=nil)
  preso = {}
  perspective = self.presenter.to_proc.call(object)
  self.key_map.each do |k,v|
    context[v] = perspective.send(k)
  end
  {}
end

#inspectObject



52
53
54
# File 'lib/expo2.rb', line 52

def inspect
  "<Expo2::Asider>"
end