Sha256: 64c122925faa13012f1cfd0066f0d67cc36db40a976d53c02f250e9847493ac7

Contents?: true

Size: 926 Bytes

Versions: 1

Compression:

Stored size: 926 Bytes

Contents

require File.join(File.dirname(__FILE__), 'arguments', 'torrent_add')
require File.join(File.dirname(__FILE__), 'arguments', 'torrent_get')
require File.join(File.dirname(__FILE__), 'arguments', 'torrent_set')
require File.join(File.dirname(__FILE__), 'arguments', 'session_get')
require File.join(File.dirname(__FILE__), 'arguments', 'session_set')
require File.join(File.dirname(__FILE__), 'arguments', 'session_stats')

module Transmission
  class Arguments
    class InvalidArgument < StandardError; end

    attr_accessor :arguments

    def initialize(arguments = nil)
      @arguments = arguments.inject([]) do |attributes, attribute|
        raise Transmission::Arguments::InvalidArgument unless self.class::ATTRIBUTES.include? attribute
        attributes << attribute
      end if arguments
      @arguments = self.class::ATTRIBUTES if arguments.nil?
    end

    def to_arguments
      @arguments
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transmission-rpc-ruby-0.1.0 lib/transmission/arguments.rb