Class: Imgix::Rails::Tag
- Inherits:
-
Object
- Object
- Imgix::Rails::Tag
- Includes:
- ActionView::Helpers, UrlHelper
- Defined in:
- lib/imgix/rails/tag.rb
Direct Known Subclasses
Constant Summary collapse
- @@parameters =
nil
Class Method Summary collapse
-
.available_parameters ⇒ Object
Store our parameter information on the class instance so that each instance of any this class or our subclasses doesn’t have to go back to disk to get this configuration information.
- .parameters ⇒ Object
Instance Method Summary collapse
-
#initialize(source, options = {}) ⇒ Tag
constructor
A new instance of Tag.
Methods included from UrlHelper
Constructor Details
#initialize(source, options = {}) ⇒ Tag
Returns a new instance of Tag.
26 27 28 29 |
# File 'lib/imgix/rails/tag.rb', line 26 def initialize(source, ={}) @source = source = end |
Class Method Details
.available_parameters ⇒ Object
Store our parameter information on the class instance so that each instance of any this class or our subclasses doesn’t have to go back to disk to get this configuration information
12 13 14 |
# File 'lib/imgix/rails/tag.rb', line 12 def self.available_parameters @@available_parameters ||= parameters.keys end |
.parameters ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/imgix/rails/tag.rb', line 16 def self.parameters return @@parameters if @@parameters path = File.("../../../../vendor/parameters.json", __FILE__) @@parameters = JSON.parse(File.read(path), symbolize_names: true)[:parameters] @@parameters[:widths] = nil @@parameters end |