Class: Finexclub::Images
- Inherits:
-
Object
- Object
- Finexclub::Images
- Extended by:
- Forwardable
- Defined in:
- lib/finexclub/images.rb
Defined Under Namespace
Classes: Middleware
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#core ⇒ Object
readonly
Returns the value of attribute core.
-
#screenshot_path ⇒ Object
Returns the value of attribute screenshot_path.
Instance Method Summary collapse
- #configure_endpoint(path_prefix = nil) ⇒ Object
-
#initialize(core) ⇒ Images
constructor
A new instance of Images.
- #store(filename) ⇒ Object
Constructor Details
#initialize(core) ⇒ Images
Returns a new instance of Images.
13 14 15 16 |
# File 'lib/finexclub/images.rb', line 13 def initialize(core) @core = core @app = Dragonfly[:images] end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/finexclub/images.rb', line 8 def app @app end |
#core ⇒ Object (readonly)
Returns the value of attribute core.
7 8 9 |
# File 'lib/finexclub/images.rb', line 7 def core @core end |
#screenshot_path ⇒ Object
Returns the value of attribute screenshot_path.
9 10 11 |
# File 'lib/finexclub/images.rb', line 9 def screenshot_path @screenshot_path end |
Instance Method Details
#configure_endpoint(path_prefix = nil) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/finexclub/images.rb', line 24 def configure_endpoint(path_prefix = nil) path_prefix ||= "/media" @app.configure_with(:rmagick) do |c| c.url_path_prefix = path_prefix end end |
#store(filename) ⇒ Object
18 19 20 21 22 |
# File 'lib/finexclub/images.rb', line 18 def store(filename) path = screenshot_path || "" file = File.(File.join(path, filename)) app.store File.new(file) end |