Commit 67327952 authored by Shinya Maeda's avatar Shinya Maeda

Add memoization for properties

parent c425ff75
...@@ -76,19 +76,25 @@ class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migrati ...@@ -76,19 +76,25 @@ class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migrati
end end
def api_url def api_url
JSON.parse(self.properties)['api_url'] parsed_properties['api_url']
end end
def ca_pem def ca_pem
JSON.parse(self.properties)['ca_pem'] parsed_properties['ca_pem']
end end
def namespace def namespace
JSON.parse(self.properties)['namespace'] parsed_properties['namespace']
end end
def token def token
JSON.parse(self.properties)['token'] parsed_properties['token']
end
private
def parsed_properties
@parsed_properties ||= JSON.parse(self.properties)
end end
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