Sha256: fd2766758d25f550329fbd7d523c62b610faa20f43bb930b8534f3926e818cbe
Contents?: true
Size: 839 Bytes
Versions: 37
Compression:
Stored size: 839 Bytes
Contents
class Gillbus class Tariff class ReturnCause LOSSLESS = 'lossless'.freeze extend Fields include UpdateAttrs field :lossless, :bool field :cause, :string # rubocop:disable Lint/UnusedMethodArgument def self.parse(doc, instance: nil, parent: nil, options: {}) instance = new if doc.is_a?(Array) && doc.size == 2 && doc.first.is_a?(Hash) && doc.last.is_a?(String) instance.lossless = doc.first[LOSSLESS] == Parser::TRUE_CONST instance.cause = doc.last elsif doc.is_a?(Hash) && doc.has_key?('__content__') instance.lossless = (doc['lossless'] == 'true') instance.cause = doc['__content__'] else instance.cause = doc instance.lossless = false end instance end end end end
Version data entries
37 entries across 37 versions & 1 rubygems