summaryrefslogtreecommitdiff
path: root/lib/github
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-19 19:14:40 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-24 16:17:52 -0300
commitf35573f12eb579b31b014fa99509c694021c33c7 (patch)
tree6f615c24db9f2c975f4972b1f3a93f4fbab0938b /lib/github
parenta32adb82dc5b27069835219a5189f497686b8b04 (diff)
downloadgitlab-ce-f35573f12eb579b31b014fa99509c694021c33c7.tar.gz
Extract common attributes to Github::Representation::Base
Diffstat (limited to 'lib/github')
-rw-r--r--lib/github/representation/base.rb12
-rw-r--r--lib/github/representation/comment.rb12
-rw-r--r--lib/github/representation/issue.rb12
-rw-r--r--lib/github/representation/label.rb4
-rw-r--r--lib/github/representation/milestone.rb12
-rw-r--r--lib/github/representation/pull_request.rb12
6 files changed, 12 insertions, 52 deletions
diff --git a/lib/github/representation/base.rb b/lib/github/representation/base.rb
index 6765bfb803b..5ea294ed49c 100644
--- a/lib/github/representation/base.rb
+++ b/lib/github/representation/base.rb
@@ -5,6 +5,18 @@ module Github
@raw = raw
end
+ def url
+ raw['url']
+ end
+
+ def created_at
+ raw['created_at']
+ end
+
+ def updated_at
+ raw['updated_at']
+ end
+
private
attr_reader :raw
diff --git a/lib/github/representation/comment.rb b/lib/github/representation/comment.rb
index 819e4107118..02bcd9eaa0e 100644
--- a/lib/github/representation/comment.rb
+++ b/lib/github/representation/comment.rb
@@ -24,18 +24,6 @@ module Github
'LegacyDiffNote' if on_diff?
end
- def url
- raw['url']
- end
-
- def created_at
- raw['created_at']
- end
-
- def updated_at
- raw['updated_at']
- end
-
private
def generate_line_code(line)
diff --git a/lib/github/representation/issue.rb b/lib/github/representation/issue.rb
index f155880b984..3bb767a5daa 100644
--- a/lib/github/representation/issue.rb
+++ b/lib/github/representation/issue.rb
@@ -37,18 +37,6 @@ module Github
raw['state'] == 'closed' ? 'closed' : 'opened'
end
- def url
- raw['url']
- end
-
- def created_at
- raw['created_at']
- end
-
- def updated_at
- raw['updated_at']
- end
-
def assigned?
raw['assignee'].present?
end
diff --git a/lib/github/representation/label.rb b/lib/github/representation/label.rb
index b3140ab76fc..60aa51f9569 100644
--- a/lib/github/representation/label.rb
+++ b/lib/github/representation/label.rb
@@ -8,10 +8,6 @@ module Github
def title
raw['name']
end
-
- def url
- raw['url']
- end
end
end
end
diff --git a/lib/github/representation/milestone.rb b/lib/github/representation/milestone.rb
index 5ea54eb178f..917e6394ad4 100644
--- a/lib/github/representation/milestone.rb
+++ b/lib/github/representation/milestone.rb
@@ -20,18 +20,6 @@ module Github
def state
raw['state'] == 'closed' ? 'closed' : 'active'
end
-
- def url
- raw['url']
- end
-
- def created_at
- raw['created_at']
- end
-
- def updated_at
- raw['updated_at']
- end
end
end
end
diff --git a/lib/github/representation/pull_request.rb b/lib/github/representation/pull_request.rb
index 85f4e1bdac3..b33561565bf 100644
--- a/lib/github/representation/pull_request.rb
+++ b/lib/github/representation/pull_request.rb
@@ -71,18 +71,6 @@ module Github
'opened'
end
- def url
- raw['url']
- end
-
- def created_at
- raw['created_at']
- end
-
- def updated_at
- raw['updated_at']
- end
-
def assigned?
raw['assignee'].present?
end