Sha256: 06a7f57584abdffb6edf23021aec827e0e2d7e996d39672ce3e5a8cd726d4211

Contents?: true

Size: 425 Bytes

Versions: 3

Compression:

Stored size: 425 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, *)
    super || object.respond_to?(m, true)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bmc-1.3.5 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.3.4 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.3.3 app/libs/bmc/mini_model_serializer/serializer.rb