Class: ODDB::View::CurrencyNavigationLink

Inherits:
HtmlGrid::Link
  • Object
show all
Defined in:
src/view/navigationlink.rb

Constant Summary

CSS_CLASS =
"list"

Instance Method Summary (collapse)

Instance Method Details

- (Object) init



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'src/view/navigationlink.rb', line 41

def init
  super
  current = @session.currency
  unless(current == @name.to_s)
    path = @session.request_path.dup
    path.slice!(/\/$/u)
    if(path.count('/') < 3)
      args = { :currency => @name }
      path = @lookandfeel._event_url(:self, args)
    else
      path.slice!(/\/currency\/[^\/]*/u)
      path << '/currency/' << @name.to_s
    end
    @attributes.store("href", path)
  end
end