class YNRequest

Attributes

hash[R]

Public Class Methods

new(content="") click to toggle source
# File lib/yn_request.rb, line 8
def initialize(content="")
        @hash = Hash.new
        if content != ""
                _arr = []
                _arr = content.include?("&") ? content.split("&") : _arr.push(content)
                _arr.each do |e|
                        __arr = e.split("=")
                        @hash[__arr[0].to_sym]=__arr[1]
                end
        end           
end

Public Instance Methods

each() { |e| ... } click to toggle source
# File lib/yn_request.rb, line 24
def each
        raise 'please provide a block!' unless block_given?
        @hash.each do |e|
                yield e
        end
end
get(key) click to toggle source
# File lib/yn_request.rb, line 20
def get(key)
        @hash[key.to_sym]
end