Class: Picturefill::Context
- Inherits:
-
Object
- Object
- Picturefill::Context
- Defined in:
- lib/picturefill/context.rb
Defined Under Namespace
Classes: IMAGE
Instance Method Summary collapse
- #each(&blk) ⇒ Object
-
#initialize(&blk) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(&blk) ⇒ Context
Returns a new instance of Context.
6 7 8 9 |
# File 'lib/picturefill/context.rb', line 6 def initialize(&blk) @self_before_instance_eval = eval("self", blk.binding) instance_eval(&blk) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
56 57 58 |
# File 'lib/picturefill/context.rb', line 56 def method_missing(method, *args, &block) @self_before_instance_eval.send(method, *args, &block) end |
Instance Method Details
#each(&blk) ⇒ Object
11 12 13 |
# File 'lib/picturefill/context.rb', line 11 def each(&blk) (@images ||= []).each(&blk) end |