Class: PepipostSdkRuby::Attributes

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



13
14
15
# File 'lib/pepipost_sdk_ruby/models/attributes.rb', line 13

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

Instance Attribute Details

#nameArray<String>

TODO: Write general description for this method

Returns:

  • (Array<String>)


7
8
9
# File 'lib/pepipost_sdk_ruby/models/attributes.rb', line 7

def name
  @name
end

#regidArray<String>

TODO: Write general description for this method

Returns:

  • (Array<String>)


11
12
13
# File 'lib/pepipost_sdk_ruby/models/attributes.rb', line 11

def regid
  @regid
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



24
25
26
27
28
29
# File 'lib/pepipost_sdk_ruby/models/attributes.rb', line 24

def key_map
  hash = {}
  hash['NAME'] = name
  hash['REGID'] = regid
  hash
end

#to_jsonObject

Creates JSON of the curent object



18
19
20
21
# File 'lib/pepipost_sdk_ruby/models/attributes.rb', line 18

def to_json
  hash = key_map
  hash.to_json
end