diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-23 18:25:32 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-23 18:25:32 -0700 |
commit | ab7494d42eae74133e6cf6d4d6c85aeaecf19939 (patch) | |
tree | e24044f09029aaee4907b2bbe92efe70ad54e2c3 | |
parent | 7a5adb16225e564e06618539a24c0da818adf2c2 (diff) | |
download | ruby-libmpd-ab7494d42eae74133e6cf6d4d6c85aeaecf19939.tar.gz ruby-libmpd-ab7494d42eae74133e6cf6d4d6c85aeaecf19939.tar.xz |
Add to_i method to true and false objects.
-rw-r--r-- | libmpd.rb | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -6,6 +6,20 @@ require 'socket' +class TrueClass + # Return integer 1. + def to_i + return 1 + end +end + +class FalseClass + # Return integer 0. + def to_i + return 0 + end +end + class MPD # Initialise an MPD object with the specified host and port. # @@ -85,7 +99,7 @@ class MPD return send_request command end - # Toggles pause. (1 = pause, 0 = play) + # Toggles pause. def pause pause return send_request 'pause ' + pause.to_s end |