lib/finix/resources/resource.rb in finix-0.11 vs lib/finix/resources/resource.rb in finix-0.12
- old
+ new
@@ -21,11 +21,11 @@
property = key.sub(/.*?\./, '')
if property == 'self'
@hyperlinks[:self] = link[:href]
else
- @hyperlinks[property] = Finix::Utils.callable(Finix::Pagination.new(link[:href], {}))
+ @hyperlinks[property] = Finix::Utils.callable(Finix::Utils.eval_class(self, 'Pagination').new link[:href], {})
end
end
end
def fetch(*arguments)
@@ -88,14 +88,10 @@
def to_s
"#{self.class.name.split('::').last || ''} #{@attributes}"
end
- def inspect
- to_s
- end
-
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
@@ -110,10 +106,10 @@
end
def fetch(*arguments)
if arguments.nil? or arguments.empty? or arguments[0].nil? or arguments[0].to_s.empty?
href = Finix.hypermedia_registry.key(self)
- return Finix::Pagination.new href
+ return Finix::Utils.eval_class(self, 'Pagination').new href
end
options = arguments.slice!(0) or {}
if options.is_a? String and options =~ URI::regexp
href = options