Class: Pepipost::Settings

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



31
32
33
34
35
36
# File 'lib/pepipost/models/settings.rb', line 31

def initialize
  @footer = true
  @clicktrack = true
  @opentrack = true
  @unsubscribe = true
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



38
39
40
# File 'lib/pepipost/models/settings.rb', line 38

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

Instance Attribute Details

#attachmentidString

TODO: Write general description for this method

Returns:

  • (String)


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

def attachmentid
  @attachmentid
end

#bccString

TODO: Write general description for this method

Returns:

  • (String)


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

def bcc
  @bcc
end

#clicktrackBoolean

TODO: Write general description for this method

Returns:

  • (Boolean)


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

def clicktrack
  @clicktrack
end

TODO: Write general description for this method

Returns:

  • (Boolean)


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

def footer
  @footer
end

#opentrackBoolean

TODO: Write general description for this method

Returns:

  • (Boolean)


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

def opentrack
  @opentrack
end

#templateNumeric

TODO: Write general description for this method

Returns:

  • (Numeric)


29
30
31
# File 'lib/pepipost/models/settings.rb', line 29

def template
  @template
end

#unsubscribeBoolean

TODO: Write general description for this method

Returns:

  • (Boolean)


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

def unsubscribe
  @unsubscribe
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/pepipost/models/settings.rb', line 49

def key_map
  hash = {}
  hash['footer'] = footer
  hash['clicktrack'] = clicktrack
  hash['opentrack'] = opentrack
  hash['unsubscribe'] = unsubscribe
  hash['bcc'] = bcc
  hash['attachmentid'] = attachmentid
  hash['template'] = template
  hash
end

#to_jsonObject

Creates JSON of the curent object



43
44
45
46
# File 'lib/pepipost/models/settings.rb', line 43

def to_json
  hash = key_map
  hash.to_json
end