lib/groovehq/resource.rb in groovehq-1.0.4 vs lib/groovehq/resource.rb in groovehq-1.0.5
- old
+ new
@@ -13,16 +13,16 @@
links = data.delete(:links) { ActiveSupport::HashWithIndifferentAccess.new }
links[:self] = { href: data.delete(:href) } if data.has_key?(:href)
@data = OpenStruct.new(data.with_indifferent_access)
- @rels = parse_links(links).with_indifferent_access
+ @rels = parse_links(links)
end
def parse_links(links)
(links || {}).each_with_object({}) do |(relation, value), result|
result[relation] = Relation.new(@client, value[:href])
- end
+ end.with_indifferent_access
end
def method_missing(method_sym, *arguments, &block)
if @data.respond_to?(method_sym)
@data.send(method_sym)