Sha256: ddba16bda12d14ebd36e1a6993aa9ada6f56fe27a2754baeb6983e7f505106c2

Contents?: true

Size: 439 Bytes

Versions: 2

Compression:

Stored size: 439 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, *)
    if respond_to_missing?(m)
      object.send(m, *)
    else
      super
    end
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bmc-1.6.1 app/libs/bmc/mini_model_serializer/serializer.rb
bmc-1.6.0 app/libs/bmc/mini_model_serializer/serializer.rb