Class: Coppertone::MacroString::MacroLiteral

Inherits:
Object
  • Object
show all
Defined in:
lib/coppertone/macro_string/macro_literal.rb

Overview

A internal class that represents a fixed string in the macro template, whose value will not depend on the SPF request context.

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ MacroLiteral

Returns a new instance of MacroLiteral.



6
7
8
# File 'lib/coppertone/macro_string/macro_literal.rb', line 6

def initialize(s)
  @str = s
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
21
# File 'lib/coppertone/macro_string/macro_literal.rb', line 18

def ==(other)
  return false unless other.instance_of? self.class
  to_s == other.to_s
end

#expand(_context, _request = nil) ⇒ Object



10
11
12
# File 'lib/coppertone/macro_string/macro_literal.rb', line 10

def expand(_context, _request = nil)
  @str
end

#to_sObject



14
15
16
# File 'lib/coppertone/macro_string/macro_literal.rb', line 14

def to_s
  @str
end