Sha256: c3d7c53109f2f33e805cc9e85773acfecb4067f5815c47c73d7826ef11449ede
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
# # Ronin - A Ruby platform for exploit development and security research. # # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # module Ronin module Code module Emittable # # Default emit method which simply returns +nil+. # def emit [] end protected # # Emits a Token with the specified _name_. # def emit_token(name) [Token.new(name)] end # # Emits the specified _value_ if _value_ is an Emittable object, # otherwise _value_ will be returned. # def emit_value(value) if value.kind_of?(Emittable) return value.emit else return [value] end end # # Emits each of the specified _valueis_. # def emit_values(values) values.inject([]) { |tokens,value| tokens + emit_value(value) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ronin-0.3.0 | lib/ronin/code/emittable.rb |