Get an array of all products attributes in magento2

[php]Sample model file : Dys\Ajaxsearch\Model\Searchtype.php code as below

namespace Dys\Ajaxsearch\Model;
use Magento\Catalog\Model;

class Searchtype implements \Magento\Framework\Option\ArrayInterface
{

protected $objectManager;

public function __construct( \Magento\Framework\ObjectManagerInterface $interface ) {
$this->objectManager = $interface;
}

/**
* Options getter
*
* @return array
*/
public function toOptionArray( $isMultiselect = false)
{
$customer_attributes = $this->objectManager->get('Magento\Catalog\Model\Product')->getAttributes();

$attributesArrays = array();

foreach($customer_attributes as $cal=>$val){
$attributesArrays[] = array(
'label' => $cal,
'value' => $val
);
}

return $attributesArrays;
}
}
?>

How to use :
use Dys\Ajaxsearch\Model\Attributes
[/php]