Class: MuSL::Maker::Send

Inherits:
Block
  • Object
show all
Includes:
Mu::Helper
Defined in:
lib/mu/maker.rb

Constant Summary

Constants included from Mu::Helper

Mu::Helper::ESCAPES

Instance Attribute Summary

Attributes inherited from Block

#scenario

Instance Method Summary collapse

Methods included from Mu::Helper

#ask, #bin2hex, #error, #escape, #format_float, #get_file_as_string_array, #make_xml, #msg, #shift, #to_boolean

Methods inherited from Block

#comment, #initialize

Constructor Details

This class inherits a constructor from MuSL::Maker::Block

Instance Method Details

#base64_encode(kvs = {}) ⇒ Object



179
180
181
182
183
184
185
186
187
# File 'lib/mu/maker.rb', line 179

def base64_encode kvs={}
    if block_given?
        scenario.block 'base64_encode' + scenario.attrs(kvs) + ' [', ']' do
            yield self
        end
    else
        scenario.line 'base64_encode' + scenario.attrs(kvs)
    end
end

#block(start, finish) ⇒ Object



209
210
211
212
213
# File 'lib/mu/maker.rb', line 209

def block start, finish
    scenario.block start, finish do
        yield self
    end
end

#compress(type) ⇒ Object



215
216
217
218
219
# File 'lib/mu/maker.rb', line 215

def compress type
    scenario.block type + '_compress [', ']' do
        yield self
    end
end

#header(name, kvs = {}) ⇒ Object



221
222
223
224
225
226
227
228
229
230
231
# File 'lib/mu/maker.rb', line 221

def header name, kvs={}
    kvs['header_name'] = name
    if block_given?
        scenario.block 'header(header_name:"' + name + '") [', ']' do
        #scenario.block 'header' + scenario.attrs(kvs) + ' [', ']' do
            yield self
        end
    else
        scenario.line 'header' + scenario.attrs(kvs)
    end
end

#hex_encode(kvs = {}) ⇒ Object



199
200
201
202
203
204
205
206
207
# File 'lib/mu/maker.rb', line 199

def hex_encode kvs={}
    if block_given?
        scenario.block 'hex_encode' + scenario.attrs(kvs) + ' [', ']' do
            yield self
        end
    else
        scenario.line 'hex_encode' + scenario.attrs(kvs)
    end
end

#length_string(kvs = {}) ⇒ Object



233
234
235
# File 'lib/mu/maker.rb', line 233

def length_string kvs={}
    scenario.line 'length_string' + scenario.attrs(kvs)
end

#line(text = '') ⇒ Object



237
238
239
240
241
242
243
244
245
# File 'lib/mu/maker.rb', line 237

def line text=''
    if block_given?
        scenario.block 'line [', ']' do
            yield self
        end
    else
        scenario.line('"' + escape(text) + '\r\n"')
    end
end

#literal(text) ⇒ Object



251
252
253
# File 'lib/mu/maker.rb', line 251

def literal text
    scenario.literal text
end

#literal_no_format(text) ⇒ Object



255
256
257
# File 'lib/mu/maker.rb', line 255

def literal_no_format text
    scenario.literal_no_format text
end

#string(text = '') ⇒ Object



247
248
249
# File 'lib/mu/maker.rb', line 247

def string text=''
    scenario.line('"' + escape(text) + '"')
end

#uri_percent_encode(kvs = {}) ⇒ Object



189
190
191
192
193
194
195
196
197
# File 'lib/mu/maker.rb', line 189

def uri_percent_encode kvs={}
    if block_given?
        scenario.block 'uri_percent_encode' + scenario.attrs(kvs) + ' [', ']' do
            yield self
        end
    else
        scenario.line 'uri_percent_encode' + scenario.attrs(kvs)
    end
end