Sha256: 1747d7d232e8e99542a6f07a3009746cdb5f28b7e245f26ab36b1e00cb5fa55e

Contents?: true

Size: 777 Bytes

Versions: 4

Compression:

Stored size: 777 Bytes

Contents

require 'yajl'

class JobDefinition
  attr_accessor :file_queue_name, :reply_exchange_name, :source_tree_path, :sync_exclude, :callbacks

  def initialize(opts={})
    @file_queue_name = opts[:file_queue_name]
    @reply_exchange_name = opts[:reply_exchange_name]
    @source_tree_path = opts[:source_tree_path]
    @callbacks = opts[:callbacks]
    @sync_exclude = opts[:sync_exclude]
  end

  def to_json
    Yajl::Encoder.encode(to_hash)
  end

  private

  #This can probably be done with introspection somehow, but this is way easier despite being very verbose
  def to_hash
    {:file_queue_name => @file_queue_name, :reply_exchange_name => @reply_exchange_name, :source_tree_path => @source_tree_path, :sync_exclude => @sync_exclude, :callbacks => @callbacks}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gorgon-0.1.1 lib/gorgon/job_definition.rb
gorgon-0.1.0 lib/gorgon/job_definition.rb
gorgon-0.0.2 lib/gorgon/job_definition.rb
gorgon-0.0.1 lib/gorgon/job_definition.rb