lib/finix.rb in finix-0.13 vs lib/finix.rb in finix-0.14
- old
+ new
@@ -42,14 +42,15 @@
URI.parse(href).path.sub(/\/$/, '').split('/')
end
def get_href(cls)
href = Finix.hypermedia_registry.key(cls)
- href = Finix.hypermedia_registry.key(cls.superclass) if href.nil?
- if href.nil? # support wrapper module
- mod = cls.name.split('::').first
- scls = cls.superclass.superclass.name.split('::').last
- href = Finix.hypermedia_registry.key(self.instance_eval "#{mod}::#{scls}")
+ sps = cls
+ while href.nil?
+ sps = sps.superclass
+ break if sps.nil?
+ clss = Finix::Utils.eval_class cls, sps.name.split('::').last
+ href = Finix.hypermedia_registry.key(clss)
end
href
end
def from_hypermedia_registry(href, attributes={})
\ No newline at end of file