aboutsummaryrefslogtreecommitdiffstats
path: root/github3/models/base.py
blob: bd07650bb6a306d784277a3a08ba70c110ab3825 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
github3.models
~~~~~~~~~~~~~~

This package provides the Github3 object model.
"""

class BaseResource(object):
    """A BaseResource object."""

    def __init__(self, attrs=None):
        if attrs:
            for attr, value in attrs.items():
                setattr(self, attr, value)
        super(BaseResource, self).__init__()

    def __len__(self):
        return len(self.__dict__)

    @classmethod
    def idl(self):
        raise NotImplementedError('Each model need subcass that method')