Class: SFCcustom::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/sfc-custom.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Template

Returns a new instance of Template.



106
107
108
# File 'lib/sfc-custom.rb', line 106

def initialize(name)
  @name = name
end

Instance Attribute Details

#customization_signatureObject

Returns the value of attribute customization_signature.



104
105
106
# File 'lib/sfc-custom.rb', line 104

def customization_signature
  @customization_signature
end

#nameObject

Returns the value of attribute name.



104
105
106
# File 'lib/sfc-custom.rb', line 104

def name
  @name
end

Instance Method Details

#blocksObject



110
111
112
# File 'lib/sfc-custom.rb', line 110

def blocks
  [Block.new, Block.new]
end

#generate!Object



114
115
116
# File 'lib/sfc-custom.rb', line 114

def generate!
  @customization_signature = Digest::MD5.hexdigest(Time.now.to_s)
end

#preview_urlObject



118
119
120
# File 'lib/sfc-custom.rb', line 118

def preview_url
  "http://custom.sfcgraphics.com/#{@customization_signature}.jpg" if @customization_signature
end