decision-labs / fcm

Ruby bindings to Firebase Cloud Messaging (FCM) for Android, iOS or Web
MIT License
517 stars 154 forks source link

A refactoring PR of send_v1 method #104

Closed Roy-Mao closed 2 years ago

Roy-Mao commented 2 years ago

Just add a few refactoring code, mainly for #send_v1method

  1. add rspec test for #send_v1 method

    • preparation for refactoring later
  2. refactor #send_v1 method

    • to use the shared #for_uri(BASE_URI_V1, extra_headers) do end private method
  3. delete unused var / constant / comment

  4. delete attr_accessor :timeout, :api_key, :json_key_path, :project_base_uri

    • better to encapsulate these attributes within the instance itself instead of being exposed to outside