Extract common attributes to Github::Representation::Base

parent a32adb82
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -8,10 +8,6 @@ module Github
def title
raw['name']
end
def url
raw['url']
end
end
end
end
......@@ -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
......@@ -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
......
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