Sha256: fc9971c53f032941489812f1670a08dfb59b39812cfe10be896f594421bf57ae
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
module Transmission module Model class Session class SessionError < StandardError; end attr_accessor :attributes, :connector def initialize(session_object, connector) @attributes = session_object @connector = connector end def save! filtered = Transmission::Arguments::SessionSet.filter @attributes connector.set_session filtered end def to_json @attributes end def method_missing(symbol, *args) string = symbol.to_s if string[-1] == '=' string = string[0..-2] key = Transmission::Arguments::SessionSet.real_key string return @attributes[key] = args.first if !!key else key = Transmission::Fields::SessionGet.real_key string return @attributes[key] if !!key end super end class << self def get(options = {}) rpc = options[:connector] || connector body = rpc.get_session options[:fields] Session.new body, rpc end def connector Transmission::Config.get_connector end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
transmission-rpc-ruby-0.4.0 | lib/transmission/model/session.rb |
transmission-rpc-ruby-0.3.1 | lib/transmission/model/session.rb |
transmission-rpc-ruby-0.3.0 | lib/transmission/model/session.rb |