Class: Leadlight::Tint
- Inherits:
-
Module
- Object
- Module
- Leadlight::Tint
- Defined in:
- lib/leadlight/tint.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ Tint
constructor
A new instance of Tint.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, options = {}, &block) ⇒ Tint
Returns a new instance of Tint.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/leadlight/tint.rb', line 6 def initialize(name, ={}, &block) @name = @tint_name = name status_patterns = Array(.fetch(:status) { :success }) tint = self super(){ define_method(:__apply_tint__) do super() helper = TintHelper.new(self, tint) helper.exec_tint do match_status(*status_patterns) instance_eval(&block) end end } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/leadlight/tint.rb', line 5 def name @name end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/leadlight/tint.rb', line 22 def inspect "#<Leadlight::Tint:#{@tint_name}>" end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/leadlight/tint.rb', line 26 def to_s inspect end |