Extract common attributes to Github::Representation::Base

parent a32adb82
...@@ -5,6 +5,18 @@ module Github ...@@ -5,6 +5,18 @@ module Github
@raw = raw @raw = raw
end end
def url
raw['url']
end
def created_at
raw['created_at']
end
def updated_at
raw['updated_at']
end
private private
attr_reader :raw attr_reader :raw
......
...@@ -24,18 +24,6 @@ module Github ...@@ -24,18 +24,6 @@ module Github
'LegacyDiffNote' if on_diff? 'LegacyDiffNote' if on_diff?
end end
def url
raw['url']
end
def created_at
raw['created_at']
end
def updated_at
raw['updated_at']
end
private private
def generate_line_code(line) def generate_line_code(line)
......
...@@ -37,18 +37,6 @@ module Github ...@@ -37,18 +37,6 @@ module Github
raw['state'] == 'closed' ? 'closed' : 'opened' raw['state'] == 'closed' ? 'closed' : 'opened'
end end
def url
raw['url']
end
def created_at
raw['created_at']
end
def updated_at
raw['updated_at']
end
def assigned? def assigned?
raw['assignee'].present? raw['assignee'].present?
end end
......
...@@ -8,10 +8,6 @@ module Github ...@@ -8,10 +8,6 @@ module Github
def title def title
raw['name'] raw['name']
end end
def url
raw['url']
end
end end
end end
end end
...@@ -20,18 +20,6 @@ module Github ...@@ -20,18 +20,6 @@ module Github
def state def state
raw['state'] == 'closed' ? 'closed' : 'active' raw['state'] == 'closed' ? 'closed' : 'active'
end end
def url
raw['url']
end
def created_at
raw['created_at']
end
def updated_at
raw['updated_at']
end
end end
end end
end end
...@@ -71,18 +71,6 @@ module Github ...@@ -71,18 +71,6 @@ module Github
'opened' 'opened'
end end
def url
raw['url']
end
def created_at
raw['created_at']
end
def updated_at
raw['updated_at']
end
def assigned? def assigned?
raw['assignee'].present? raw['assignee'].present?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment