Skip to content

Instantly share code, notes, and snippets.

@bougyman
Created February 28, 2019 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bougyman/2ae6f784c582726b15f6992d2c1e3212 to your computer and use it in GitHub Desktop.
Save bougyman/2ae6f784c582726b15f6992d2c1e3212 to your computer and use it in GitHub Desktop.
Y
128 # @return [Object] The namespace parent of this class
129 def my_parent
130 # TODO: research a better way to accomplish this
131 @my_parent ||= Object.const_get(self.class.ancestors.first.to_s.split('::')[0..-2].join('::'))
132 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment