Class: Jsonp::Utils::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonp/utils/wrapper.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(prefix, body, suffix) ⇒ Wrapper

Returns a new instance of Wrapper.



5
6
7
# File 'lib/jsonp/utils/wrapper.rb', line 5

def initialize(prefix, body, suffix)
  @prefix, @body, @suffix = prefix, body, suffix
end

Instance Method Details

#each(&block) ⇒ Object



9
10
11
12
13
# File 'lib/jsonp/utils/wrapper.rb', line 9

def each(&block)
  block.call(@prefix)
  @body.each(&block)
  block.call(@suffix)
end