lib/submodules/ably-ruby/lib/ably/modules/model_common.rb in ably-rest-1.2.2 vs lib/submodules/ably-ruby/lib/ably/modules/model_common.rb in ably-rest-1.2.3
- old
+ new
@@ -13,26 +13,31 @@
end
# Provide a normal Hash accessor to the underlying raw message object
#
# @return [Object]
+ #
def [](key)
attributes[key]
end
def ==(other)
other.kind_of?(self.class) &&
attributes == other.attributes
end
# Return a JSON ready object from the underlying #attributes using Ably naming conventions for keys
+ #
# @return [Hash]
+ #
def as_json(*args)
attributes.as_json.reject { |key, val| val.nil? }
end
# Stringify the JSON representation of this object from the underlying #attributes
+ #
# @return [String]
+ #
def to_json(*args)
as_json.to_json(*args)
end
# @!attribute [r] hash