From a42a56c9c705b77348fbe98939a911e53c332d1c Mon Sep 17 00:00:00 2001 From: Toshiaki Asai Date: Sat, 22 Oct 2016 17:01:20 +0900 Subject: openimg: Photo#inspectの結果を変更 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一度使用したPhoto modelには画像キャッシュが入っているのが、エスケープさ れたJPEGとかが表示されても役に立たないため、簡潔に表示する --- core/plugin/openimg/model/photo.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/plugin/openimg/model/photo.rb b/core/plugin/openimg/model/photo.rb index 69c1ad43..b0e61e3c 100644 --- a/core/plugin/openimg/model/photo.rb +++ b/core/plugin/openimg/model/photo.rb @@ -52,6 +52,14 @@ module Plugin::Openimg !@state end + def inspect + if @state == :complete + "#<#{self.class}: #{perma_link} (state: #{@state}, #{self.blob.size} bytes cached)>" + else + "#<#{self.class}: #{perma_link} (state: #{@state})>" + end + end + private def download!(&partial_callback) -- cgit v1.2.3