Class: Transmission::Model::SessionStats
- Inherits:
-
Object
- Object
- Transmission::Model::SessionStats
- Defined in:
- lib/transmission/model/session_stats.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#connector ⇒ Object
Returns the value of attribute connector.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(session_object, connector) ⇒ SessionStats
constructor
A new instance of SessionStats.
- #to_json ⇒ Object
Constructor Details
#initialize(session_object, connector) ⇒ SessionStats
Returns a new instance of SessionStats.
7 8 9 10 |
# File 'lib/transmission/model/session_stats.rb', line 7 def initialize(session_object, connector) @attributes = session_object @connector = connector end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/transmission/model/session_stats.rb', line 5 def attributes @attributes end |
#connector ⇒ Object
Returns the value of attribute connector.
5 6 7 |
# File 'lib/transmission/model/session_stats.rb', line 5 def connector @connector end |
Class Method Details
.connector ⇒ Object
23 24 25 |
# File 'lib/transmission/model/session_stats.rb', line 23 def connector Transmission::Config.get_connector end |
.get(options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/transmission/model/session_stats.rb', line 17 def get( = {}) rpc = [:connector] || connector body = rpc.get_session_stats [:fields] SessionStats.new body, rpc end |
Instance Method Details
#to_json ⇒ Object
12 13 14 |
# File 'lib/transmission/model/session_stats.rb', line 12 def to_json @attributes end |