dodgerogers/nucleus-core

View on GitHub
lib/nucleus_core/view_response_implementation.rb

Summary

Maintainability
A
0 mins
Test Coverage
module NucleusCore
  class ViewResponseImplementation < NucleusCore::SimpleObject
    def initialize(format, attrs={})
      status = status_code(attrs[:status])

      super(attrs.merge!(format: format, status: status))
    end

    private

    def status_code(status=nil)
      status = Utils.status_code(status)

      status.zero? ? 200 : status
    end
  end
end