Class: Pepipost::EmailDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/pepipost/models/email_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



27
28
29
# File 'lib/pepipost/models/email_details.rb', line 27

def method_missing(method_name)
  puts "there's no method called '#{method_name}'"
end

Instance Attribute Details

#contentString

TODO: Write general description for this method

Returns:

  • (String)


25
26
27
# File 'lib/pepipost/models/email_details.rb', line 25

def content
  @content
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


13
14
15
# File 'lib/pepipost/models/email_details.rb', line 13

def from
  @from
end

#fromnameString

TODO: Write general description for this method

Returns:

  • (String)


5
6
7
# File 'lib/pepipost/models/email_details.rb', line 5

def fromname
  @fromname
end

#replytoidString

TODO: Write general description for this method

Returns:

  • (String)


17
18
19
# File 'lib/pepipost/models/email_details.rb', line 17

def replytoid
  @replytoid
end

#subjectString

TODO: Write general description for this method

Returns:

  • (String)


9
10
11
# File 'lib/pepipost/models/email_details.rb', line 9

def subject
  @subject
end

#tagsString

TODO: Write general description for this method

Returns:

  • (String)


21
22
23
# File 'lib/pepipost/models/email_details.rb', line 21

def tags
  @tags
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



38
39
40
41
42
43
44
45
46
47
# File 'lib/pepipost/models/email_details.rb', line 38

def key_map
  hash = {}
  hash['fromname'] = fromname
  hash['subject'] = subject
  hash['from'] = from
  hash['replytoid'] = replytoid
  hash['tags'] = tags
  hash['content'] = content
  hash
end

#to_jsonObject

Creates JSON of the curent object



32
33
34
35
# File 'lib/pepipost/models/email_details.rb', line 32

def to_json
  hash = key_map
  hash.to_json
end