class Urbanairship::Devices::Attribute

Attributes

attribute[RW]
operator[RW]
precision[RW]
value[RW]

Public Class Methods

new(client: required('client')) click to toggle source
# File lib/urbanairship/devices/attribute.rb, line 13
def initialize(client: required('client'))
    @client = client
end

Public Instance Methods

date_attribute() click to toggle source
# File lib/urbanairship/devices/attribute.rb, line 43
def date_attribute
    {
        'attribute': attribute,
        'operator': operator,
        'precision': precision,
        'value': value
    }
end
number_attribute() click to toggle source
# File lib/urbanairship/devices/attribute.rb, line 27
def number_attribute
    {
        'attribute': attribute,
        'operator': operator,
        'value': value
    }
end
payload() click to toggle source
# File lib/urbanairship/devices/attribute.rb, line 17
def payload
    if precision
        date_attribute
    elsif value.is_a? String
        text_attribute
    elsif value.is_a? Integer 
        number_attribute
    end
end
text_attribute() click to toggle source
# File lib/urbanairship/devices/attribute.rb, line 35
def text_attribute
    {
        'attribute': attribute,
        'operator': operator,
        'value': value
    }
end