Class: DBus::Data::Int
Overview
Represents integers
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.range ⇒ Range
The full range of allowed values.
Instance Method Summary collapse
-
#initialize(value) ⇒ Int
constructor
A new instance of Int.
Methods inherited from Fixed
Methods inherited from Basic
basic?, from_typed, type, #type
Methods inherited from Base
#==, assert_type_matches_class, basic?, #eql?, fixed?, from_typed, #type, type_code
Constructor Details
#initialize(value) ⇒ Int
Returns a new instance of Int.
170 171 172 173 174 175 176 |
# File 'lib/dbus/data.rb', line 170 def initialize(value) value = value.value if value.is_a?(self.class) r = self.class.range raise RangeError, "#{value.inspect} is not a member of #{r}" unless r.member?(value) super(value) end |
Class Method Details
.range ⇒ Range
Returns the full range of allowed values.
|
# File 'lib/dbus/data.rb', line 165
|