Class: Pepipost::Files

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



7
8
9
# File 'lib/pepipost/models/files.rb', line 7

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

Instance Attribute Details

#example_attachment_1_txtString

TODO: Write general description for this method

Returns:

  • (String)


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

def example_attachment_1_txt
  @example_attachment_1_txt
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



18
19
20
21
22
# File 'lib/pepipost/models/files.rb', line 18

def key_map
  hash = {}
  hash['example_attachment1.txt'] = example_attachment_1_txt
  hash
end

#to_jsonObject

Creates JSON of the curent object



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

def to_json
  hash = key_map
  hash.to_json
end