Class: ODDB::View::TestSponsorHead::StubHeadSession

Inherits:
Object
  • Object
show all
Defined in:
test/test_view/sponsorhead.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (StubHeadSession) initialize

A new instance of StubHeadSession



20
21
22
23
# File 'test/test_view/sponsorhead.rb', line 20

def initialize
  @attributes = {}
  @enabled = true
end

Instance Attribute Details

- (Object) attributes(key)



27
28
29
# File 'test/test_view/sponsorhead.rb', line 27

def attributes(key)
  @attributes
end

- (Object) enabled=(value) (writeonly)

Sets the attribute enabled

Parameters:

  • value

    the value to set the attribute enabled to.



18
19
20
# File 'test/test_view/sponsorhead.rb', line 18

def enabled=(value)
  @enabled = value
end

Returns the value of attribute sponsor



19
20
21
# File 'test/test_view/sponsorhead.rb', line 19

def 
  @sponsor
end

Instance Method Details

- (Object) _event_url(url)



39
40
# File 'test/test_view/sponsorhead.rb', line 39

def _event_url(url)
end

- (Object) app



24
25
26
# File 'test/test_view/sponsorhead.rb', line 24

def app
  self
end

- (Object) currencies



30
31
32
# File 'test/test_view/sponsorhead.rb', line 30

def currencies
  ['CHF']
end

- (Object) currency



33
34
35
# File 'test/test_view/sponsorhead.rb', line 33

def currency
  'CHF'
end

- (Boolean) enabled?(key, default = nil)

Returns:

  • (Boolean)


36
37
38
# File 'test/test_view/sponsorhead.rb', line 36

def enabled?(key, default=nil)
  @enabled && (key != :google_adsense)
end

- (Object) format_date(date)



41
42
43
# File 'test/test_view/sponsorhead.rb', line 41

def format_date(date)
  date.strftime("%d.%m.%Y")
end

- (Object) language



44
45
46
# File 'test/test_view/sponsorhead.rb', line 44

def language
  'de'
end

- (Object) languages



47
48
49
# File 'test/test_view/sponsorhead.rb', line 47

def languages
  ['de']
end

- (Object) lookandfeel



50
51
52
# File 'test/test_view/sponsorhead.rb', line 50

def lookandfeel
  self
end

- (Object) lookup(key, name = nil)



53
54
55
# File 'test/test_view/sponsorhead.rb', line 53

def lookup(key, name=nil)
  key.to_s.upcase
end

- (Object) resource_global(key, str = nil)



56
57
58
# File 'test/test_view/sponsorhead.rb', line 56

def resource_global(key, str = nil)
  [key, str].join('/')
end

- (Object) resource_localized(key, str = nil)



59
60
61
# File 'test/test_view/sponsorhead.rb', line 59

def resource_localized(key, str = nil)
  [key, str].join('/')
end

- (Object) state



68
69
70
# File 'test/test_view/sponsorhead.rb', line 68

def state
  self
end

- (Object) user



62
63
64
# File 'test/test_view/sponsorhead.rb', line 62

def user
  self
end

- (Object) user_agent



65
66
67
# File 'test/test_view/sponsorhead.rb', line 65

def user_agent
  'TEST'
end

- (Boolean) valid?

Returns:

  • (Boolean)


71
72
73
# File 'test/test_view/sponsorhead.rb', line 71

def valid?
  false
end

- (Object) zone



74
75
76
# File 'test/test_view/sponsorhead.rb', line 74

def zone
  :drugs
end

- (Object) zones



77
78
79
# File 'test/test_view/sponsorhead.rb', line 77

def zones
  [:drugs]
end