Module: Vanillicons::ClassMethods
- Defined in:
- lib/vanillicons.rb
Instance Attribute Summary collapse
-
#vanillicon_field ⇒ Object
readonly
Returns the value of attribute vanillicon_field.
Instance Method Summary collapse
- #vanillicon(field, options = {}) ⇒ Object
- #vanillicon_defaults ⇒ Object
- #vanillicon_options ⇒ Object
Instance Attribute Details
#vanillicon_field ⇒ Object (readonly)
Returns the value of attribute vanillicon_field.
12 13 14 |
# File 'lib/vanillicons.rb', line 12 def vanillicon_field @vanillicon_field end |
Instance Method Details
#vanillicon(field, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/vanillicons.rb', line 14 def vanillicon(field, = {}) = .is_a?(Hash) ? : {} # Set the field to generate the url based on @vanillicon_field = field # Merge the options into the default options @vanillicon_options = self.vanillicon_defaults.merge() end |
#vanillicon_defaults ⇒ Object
24 25 26 27 28 29 |
# File 'lib/vanillicons.rb', line 24 def vanillicon_defaults { :secure => true, :size => 200 } end |
#vanillicon_options ⇒ Object
31 32 33 |
# File 'lib/vanillicons.rb', line 31 def @vanillicon_options || self.vanillicon_defaults end |