Class: Picturefill::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/picturefill/context.rb

Defined Under Namespace

Classes: IMAGE

Instance Method Summary collapse

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)



59
60
61
# File 'lib/picturefill/context.rb', line 59

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