Class: Kaltura::ObjectBase

Inherits:
Object
  • Object
show all
Defined in:
lib/kaltura/kaltura_client_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#object_typeObject

Returns the value of attribute object_type.



186
187
188
# File 'lib/kaltura/kaltura_client_base.rb', line 186

def object_type
  @object_type
end

Instance Method Details

#camelcase(val) ⇒ Object



210
211
212
213
# File 'lib/kaltura/kaltura_client_base.rb', line 210

def camelcase(val)
	val = val.split('_').map { |e| e.capitalize }.join()
	val[0,1].downcase + val[1,val.length]
end

#to_b(val) ⇒ Object



206
207
208
# File 'lib/kaltura/kaltura_client_base.rb', line 206

def to_b(val)
	return [true, 'true', 1, '1'].include?(val.is_a?(String) ? val.downcase : val)
end

#to_paramsObject



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/kaltura/kaltura_client_base.rb', line 188

def to_params
	params = {};
	params["objectType"] = self.class.name.split('::').last 
	instance_variables.each do |var|
		value = instance_variable_get(var)
		var = var.to_s.sub('@', '')
		kvar = camelcase(var)
		if (value != nil)
			if (value.is_a? ObjectBase)
				params[kvar] = value.to_params;
			else
				params[kvar] = value;
			end
		end
	end
	return params;
end