Repository: TheFriendlyCoder/friendlypins

Issue:
rename get_user to current_user
Seeing as how we currently only support retrieving data for the currently authenticated user, we should rename get_user to current_user and make it a property with no method parameters.

Discussion:

Patch:
diff --git a/src/friendlypins/api.py b/src/friendlypins/api.py
index cff46b6..63b0360 100644
--- a/src/friendlypins/api.py
+++ b/src/friendlypins/api.py
@@ -17,20 +17,13 @@ class API(object):  # pylint: disable=too-few-public-methods
         self._log = logging.getLogger(__name__)
         self._io = RestIO(personal_access_token)
 
-    def get_user(self, username=None):
-        """Gets all primitives associated with a particular Pinterest user
-
-        :param str username:
-            Optional name of a user to look up
-            If not provided, the currently authentcated user will be returned
-
-        :returns: Pinterest user with the given name
+    @property
+    def user(self):
+        """Gets all primitives associated with the authenticated user
+        :returns: currently authenticated pinterest user
         :rtype: :class:`friendlypins.user.User`
         """
         self._log.debug("Getting authenticated user details...")
-        if username:
-            raise NotImplementedError(
-                "Querying arbitrary Pinerest users is not yet supported.")
 
         fields = "id,username,first_name,last_name,bio,created_at,counts,image"
         result = self._io.get("me", {"fields": fields})
diff --git a/src/friendlypins/utils/console_actions.py b/src/friendlypins/utils/console_actions.py
index 8789490..761d5b9 100644
--- a/src/friendlypins/utils/console_actions.py
+++ b/src/friendlypins/utils/console_actions.py
@@ -60,7 +60,7 @@ def download_thumbnails(api_token, board_name, output_folder, delete):
     """
     log = logging.getLogger(__name__)
     obj = API(api_token)
-    user = obj.get_user()
+    user = obj.user
 
     selected_board = None
     for cur_board in user.boards:
@@ -97,7 +97,7 @@ def delete_board(api_token, board_name):
     """
     log = logging.getLogger(__name__)
     obj = API(api_token)
-    user = obj.get_user()
+    user = obj.user
 
     selected_board = None
     for cur_board in user.boards:


Test patch:
diff --git a/unit_tests/test_api.py b/unit_tests/test_api.py
index b013c9e..8332b3f 100644
--- a/unit_tests/test_api.py
+++ b/unit_tests/test_api.py
@@ -21,7 +21,7 @@ def test_get_user():
         mock_io.return_value = mock_obj
 
         obj = API('abcd1234')
-        result = obj.get_user()
+        result = obj.user
 
         assert expected_url == result.url
         assert expected_firstname == result.first_name