class Parse::Bytes
Attributes
value[RW]
Public Class Methods
new(data)
click to toggle source
# File lib/parse/datatypes.rb, line 133 def initialize(data) bytes = data["base64"] @value = Base64.decode64(bytes) end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/parse/datatypes.rb, line 149 def <=>(other) value <=> other.value end
eql?(other)
click to toggle source
# File lib/parse/datatypes.rb, line 138 def eql?(other) self.class.equal?(other.class) && value == other.value end
Also aliased as: ==
hash()
click to toggle source
# File lib/parse/datatypes.rb, line 145 def hash value.hash end
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/parse/datatypes.rb, line 153 def method_missing(method, *args, &block) if value.respond_to?(method) value.send(method, *args, &block) else super(method) end end
respond_to?(method, include_private = false)
click to toggle source
Calls superclass method
# File lib/parse/datatypes.rb, line 161 def respond_to?(method, include_private = false) super || value.respond_to?(method, include_private) end
to_h(*a)
click to toggle source
# File lib/parse/datatypes.rb, line 165 def to_h(*a) { Protocol::KEY_TYPE => Protocol::TYPE_BYTES, "base64" => Base64.encode64(@value) } end
Also aliased as: as_json
to_json(*a)
click to toggle source
# File lib/parse/datatypes.rb, line 173 def to_json(*a) to_h.to_json(*a) end