Sha256: a851c54749c7ec963f9958cf3394440285eda595955b229170697fa9e21cb0e4

Contents?: true

Size: 447 Bytes

Versions: 6

Compression:

Stored size: 447 Bytes

Contents

class BMC::MiniModelSerializer::Serializer < BMC::MiniModelSerializer::Serialize
  def attributes
    raise NotImplementedError
  end

  def call
    serialize(attributes.index_with { |k| send(k) })
  end

  private

  def method_missing(m, *args)
    if respond_to_missing?(m)
      object.send(m, *args)
    else
      super
    end
  end

  def respond_to_missing?(m, include_private = false)
    super || object.respond_to?(m, true)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bmc-1.5.1 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.5.0 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.4.3 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.4.2 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.4.1 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.4.0 app/libs/bmc/mini_model_serializer/serializer.rb