Class: Antwort::EmailData

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/antwort/email/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#symbolize_keys!

Constructor Details

#initialize(opts = {}) ⇒ EmailData

Returns a new instance of EmailData.



9
10
11
12
13
14
# File 'lib/antwort/email/data.rb', line 9

def initialize(opts = {})
  @name = opts[:name] || ''
  @path = (opts[:path] || Dir.pwd) + '/data'
  @file = opts[:file] || "#{@path}/#{@name}.yml"
  @data = load_yaml_data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/antwort/email/data.rb', line 7

def data
  @data
end

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/antwort/email/data.rb', line 7

def file
  @file
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/antwort/email/data.rb', line 7

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/antwort/email/data.rb', line 7

def path
  @path
end