Class: BatchlyApi::Parameter

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



11
12
13
# File 'lib/batchly_api/models/parameter.rb', line 11

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

Instance Attribute Details

#nameString

TODO: Write general description for this method

Returns:

  • (String)


8
9
10
# File 'lib/batchly_api/models/parameter.rb', line 8

def name
  @name
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



22
23
24
25
26
# File 'lib/batchly_api/models/parameter.rb', line 22

def key_map
  hash = {}
  hash['Name'] = self.name
  hash
end

#to_jsonObject

Creates JSON of the curent object



16
17
18
19
# File 'lib/batchly_api/models/parameter.rb', line 16

def to_json
  hash = self.key_map()
  hash.to_json
end