Class: Image
- Inherits:
-
Object
- Object
- Image
- Defined in:
- lib/juxtapose/application/lib/image.rb
Instance Attribute Summary collapse
-
#basedir ⇒ Object
Returns the value of attribute basedir.
-
#img ⇒ Object
Returns the value of attribute img.
Instance Method Summary collapse
- #accepted? ⇒ Boolean
- #as_json ⇒ Object
- #current? ⇒ Boolean
- #diff? ⇒ Boolean
-
#initialize(basedir, img) ⇒ Image
constructor
A new instance of Image.
- #path ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(basedir, img) ⇒ Image
Returns a new instance of Image.
4 5 6 7 |
# File 'lib/juxtapose/application/lib/image.rb', line 4 def initialize(basedir, img) self.basedir = basedir self.img = img end |
Instance Attribute Details
#basedir ⇒ Object
Returns the value of attribute basedir.
2 3 4 |
# File 'lib/juxtapose/application/lib/image.rb', line 2 def basedir @basedir end |
#img ⇒ Object
Returns the value of attribute img.
2 3 4 |
# File 'lib/juxtapose/application/lib/image.rb', line 2 def img @img end |
Instance Method Details
#accepted? ⇒ Boolean
9 10 11 |
# File 'lib/juxtapose/application/lib/image.rb', line 9 def accepted? File.basename(img).match /accepted/ end |
#as_json ⇒ Object
29 30 31 32 33 34 |
# File 'lib/juxtapose/application/lib/image.rb', line 29 def as_json { path: path, img: img } end |
#current? ⇒ Boolean
13 14 15 |
# File 'lib/juxtapose/application/lib/image.rb', line 13 def current? File.basename(img).match /current/ end |
#diff? ⇒ Boolean
17 18 19 |
# File 'lib/juxtapose/application/lib/image.rb', line 17 def diff? File.basename(img).match /diff/ end |
#path ⇒ Object
21 22 23 |
# File 'lib/juxtapose/application/lib/image.rb', line 21 def path File.join("/images", img) end |
#to_json(options = {}) ⇒ Object
25 26 27 |
# File 'lib/juxtapose/application/lib/image.rb', line 25 def to_json(={}) as_json.to_json end |