Class: Pepipost::Emailv1

Inherits:
Object
  • Object
show all
Defined in:
lib/pepipost/models/emailv_1.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



31
32
33
# File 'lib/pepipost/models/emailv_1.rb', line 31

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

Instance Attribute Details

#api_keyString

Your secret API Key

Returns:

  • (String)


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

def api_key
  @api_key
end

#attributesAttributes

TODO: Write general description for this method

Returns:



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

def attributes
  @attributes
end

#email_detailsEmailDetails

TODO: Write general description for this method

Returns:



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

def email_details
  @email_details
end

#filesFiles

TODO: Write general description for this method

Returns:



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

def files
  @files
end

#recipientsArray<String>

TODO: Write general description for this method

Returns:

  • (Array<String>)


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

def recipients
  @recipients
end

#settingsSettings

TODO: Write general description for this method

Returns:



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

def settings
  @settings
end

#x_apiheaderArray<String>

TODO: Write general description for this method

Returns:

  • (Array<String>)


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

def x_apiheader
  @x_apiheader
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/pepipost/models/emailv_1.rb', line 42

def key_map
  hash = {}
  hash['api_key'] = api_key
  hash['email_details'] = email_details
  hash['X-APIHEADER'] = x_apiheader
  hash['settings'] = settings
  hash['recipients'] = recipients
  hash['attributes'] = attributes
  hash['files'] = files
  hash
end

#to_jsonObject

Creates JSON of the curent object



36
37
38
39
# File 'lib/pepipost/models/emailv_1.rb', line 36

def to_json
  hash = key_map
  hash.to_json
end