aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2016-10-22 17:01:20 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2016-10-22 19:20:20 +0900
commita42a56c9c705b77348fbe98939a911e53c332d1c (patch)
tree7e0198cd171e96b9e38aad98be40de0eaa5cad05
parentc610da913865e25d4f789014747fd315760a6f9d (diff)
downloadmikutter-a42a56c9c705b77348fbe98939a911e53c332d1c.tar.gz
openimg: Photo#inspectの結果を変更
一度使用したPhoto modelには画像キャッシュが入っているのが、エスケープさ れたJPEGとかが表示されても役に立たないため、簡潔に表示する
-rw-r--r--core/plugin/openimg/model/photo.rb8
1 files changed, 8 insertions, 0 deletions
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)