Class: ProcessOut::NativeAPMParameterDefinition
- Inherits:
-
Object
- Object
- ProcessOut::NativeAPMParameterDefinition
- Defined in:
- lib/processout/native_apm_parameter_definition.rb
Instance Attribute Summary collapse
-
#available_values ⇒ Object
Returns the value of attribute available_values.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#key ⇒ Object
Returns the value of attribute key.
-
#length ⇒ Object
Returns the value of attribute length.
-
#required ⇒ Object
Returns the value of attribute required.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data
-
Hash
of data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ NativeAPMParameterDefinition
constructor
- Initializes the NativeAPMParameterDefinition object Params:
client
ProcessOut
client instancedata
-
data that can be used to fill the object.
- Initializes the NativeAPMParameterDefinition object Params:
-
#new(data = {}) ⇒ Object
Create a new NativeAPMParameterDefinition using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data
-
Hash
of data.
- Prefills the object with the data passed as parameters Params:
-
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ NativeAPMParameterDefinition
Initializes the NativeAPMParameterDefinition object Params:
client
-
ProcessOut
client instance data
-
data that can be used to fill the object
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 64 def initialize(client, data = {}) @client = client self.key = data.fetch(:key, nil) self.type = data.fetch(:type, nil) self.required = data.fetch(:required, nil) self.length = data.fetch(:length, nil) self.display_name = data.fetch(:display_name, nil) self.available_values = data.fetch(:available_values, nil) end |
Instance Attribute Details
#available_values ⇒ Object
Returns the value of attribute available_values.
16 17 18 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 16 def available_values @available_values end |
#display_name ⇒ Object
Returns the value of attribute display_name.
15 16 17 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 15 def display_name @display_name end |
#key ⇒ Object
Returns the value of attribute key.
11 12 13 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 11 def key @key end |
#length ⇒ Object
Returns the value of attribute length.
14 15 16 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 14 def length @length end |
#required ⇒ Object
Returns the value of attribute required.
13 14 15 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 13 def required @required end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 12 def type @type end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data
-
Hash
of data coming from the API
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 96 def fill_with_data(data) if data.nil? return self end if data.include? "key" self.key = data["key"] end if data.include? "type" self.type = data["type"] end if data.include? "required" self.required = data["required"] end if data.include? "length" self.length = data["length"] end if data.include? "display_name" self.display_name = data["display_name"] end if data.include? "available_values" self.available_values = data["available_values"] end self end |
#new(data = {}) ⇒ Object
Create a new NativeAPMParameterDefinition using the current client
77 78 79 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 77 def new(data = {}) NativeAPMParameterDefinition.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data
-
Hash
of data
125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 125 def prefill(data) if data.nil? return self end self.key = data.fetch(:key, self.key) self.type = data.fetch(:type, self.type) self.required = data.fetch(:required, self.required) self.length = data.fetch(:length, self.length) self.display_name = data.fetch(:display_name, self.display_name) self.available_values = data.fetch(:available_values, self.available_values) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/processout/native_apm_parameter_definition.rb', line 82 def to_json() { "key": self.key, "type": self.type, "required": self.required, "length": self.length, "display_name": self.display_name, "available_values": self.available_values, }.to_json end |