Class: Resizing::PublicId
- Inherits:
-
Object
- Object
- Resizing::PublicId
- Defined in:
- lib/resizing/public_id.rb
Instance Method Summary collapse
-
#empty? ⇒ Boolean
nil / 空文字 / 空白のみの文字列はいずれも「値なし」として扱う.
-
#filename ⇒ Object
temporary.
- #identifier ⇒ Object
- #image_id ⇒ Object
-
#initialize(public_id) ⇒ PublicId
constructor
A new instance of PublicId.
- #project_id ⇒ Object
- #to_s ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(public_id) ⇒ PublicId
Returns a new instance of PublicId.
5 6 7 8 |
# File 'lib/resizing/public_id.rb', line 5 def initialize(public_id) @public_id = public_id parsed end |
Instance Method Details
#empty? ⇒ Boolean
nil / 空文字 / 空白のみの文字列はいずれも「値なし」として扱う
11 12 13 |
# File 'lib/resizing/public_id.rb', line 11 def empty? @public_id.to_s.strip.empty? end |
#filename ⇒ Object
temporary
28 29 30 |
# File 'lib/resizing/public_id.rb', line 28 def filename image_id end |
#identifier ⇒ Object
32 33 34 |
# File 'lib/resizing/public_id.rb', line 32 def identifier "/projects/#{project_id}/upload/images/#{image_id}" end |
#image_id ⇒ Object
15 16 17 |
# File 'lib/resizing/public_id.rb', line 15 def image_id parsed[:image_id] if parsed end |
#project_id ⇒ Object
19 20 21 |
# File 'lib/resizing/public_id.rb', line 19 def project_id parsed[:project_id] if parsed end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/resizing/public_id.rb', line 36 def to_s @public_id.to_s end |
#version ⇒ Object
23 24 25 |
# File 'lib/resizing/public_id.rb', line 23 def version parsed[:version] if parsed end |