Class: InfobipApi::ObjectArrayConversionRule

Inherits:
FieldConversionRule show all
Defined in:
lib/infobipapi/objects.rb

Instance Attribute Summary

Attributes inherited from FieldConversionRule

#json_field_name, #object_field_name

Instance Method Summary collapse

Constructor Details

#initialize(classs, json_field_name = nil) ⇒ ObjectArrayConversionRule

Returns a new instance of ObjectArrayConversionRule.



57
58
59
60
# File 'lib/infobipapi/objects.rb', line 57

def initialize(classs, json_field_name = nil)
    super(json_field_name)
    @classs = classs
end

Instance Method Details

#from_json(values) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/infobipapi/objects.rb', line 62

def from_json(values)
    if not values
        return []
    end

    result = []

    for value in values
        result.push(Conversions.from_json(@classs, value, nil))
    end

    return result
end

#to_json(value) ⇒ Object



76
77
78
# File 'lib/infobipapi/objects.rb', line 76

def to_json(value)
    # TODO
end