Sha256: a8c1b46b5fced4ee13251b4450dbe0e64088c73fff1490053ed7fd9a6edb49d6

Contents?: true

Size: 924 Bytes

Versions: 17

Compression:

Stored size: 924 Bytes

Contents

module Nucleon
module Plugin
class Translator < Nucleon.plugin_class(:nucleon, :base)

  #-----------------------------------------------------------------------------
  # Translator plugin interface
  
  #-----------------------------------------------------------------------------
  # Property accessor / modifiers

  #-----------------------------------------------------------------------------
  # Operations
  
  def parse(raw)
    logger.debug("Parsing raw data: #{raw}")
    
    properties = {}
    properties = yield(properties) if block_given?
    
    logger.debug("Completed parsing data: #{properties.inspect}")
    return properties
  end
  
  #---
  
  def generate(properties)
    logger.debug("Generating output data: #{properties.inspect}")
    
    output = ''
    output = yield(output) if block_given?
    
    logger.debug("Completed generating data: #{output}")
    return output
  end
end
end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
nucleon-0.2.16 lib/core/plugin/translator.rb
nucleon-0.2.15 lib/core/plugin/translator.rb
nucleon-0.2.14 lib/core/plugin/translator.rb
nucleon-0.2.13 lib/core/plugin/translator.rb
nucleon-0.2.12 lib/core/plugin/translator.rb
nucleon-0.2.11 lib/core/plugin/translator.rb
nucleon-0.2.10 lib/core/plugin/translator.rb
nucleon-0.2.9 lib/core/plugin/translator.rb
nucleon-0.2.8 lib/core/plugin/translator.rb
nucleon-0.2.7 lib/core/plugin/translator.rb
nucleon-0.2.6 lib/core/plugin/translator.rb
nucleon-0.2.5 lib/core/plugin/translator.rb
nucleon-0.2.4 lib/core/plugin/translator.rb
nucleon-0.2.3 lib/core/plugin/translator.rb
nucleon-0.2.2 lib/core/plugin/translator.rb
nucleon-0.2.1 lib/core/plugin/translator.rb
nucleon-0.2.0 lib/core/plugin/translator.rb