Module: ChannelManager

Defined in:
lib/channel_manager.rb

Overview

Copyright © 2007-2008 Orangery Technology Limited You can redistribute it and/or modify it under the same terms as Ruby.

a session has one brand (e.g. Lexus) and one human language (e.g. English) a session can have many products

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.debug_default_channel=(value) ⇒ Object



7
8
9
# File 'lib/channel_manager.rb', line 7

def self.debug_default_channel=(value)
  @@debug_default_channel = value
end

Instance Method Details

#_(key) ⇒ Object

helper used for human language translation



28
29
30
31
32
33
34
# File 'lib/channel_manager.rb', line 28

def _(key)
  if (session[:lang] != "en")
    trans = @dictionary[key]
    return trans unless trans == nil
  end
  key
end

#__(key) ⇒ Object

helper used to handle xpath field name translation to human understandable field label/legend TODO: generate these translation into a separate dictionary



21
22
23
24
25
# File 'lib/channel_manager.rb', line 21

def __(key)
  trans = @dictionary[key]
  return trans unless trans == nil
  key
end

#load_changes_in_channelObject



15
16
17
# File 'lib/channel_manager.rb', line 15

def load_changes_in_channel
  inject_channel unless channel_already_loaded
end

#set_channel_in_sessionObject



11
12
13
# File 'lib/channel_manager.rb', line 11

def set_channel_in_session
  set_session_data unless params_remain_unchanged
end