@@ -27,6 +27,31 @@ namespace Rice
2727 return *this ;
2828 }
2929
30+ inline bool Object::test () const
31+ {
32+ return RTEST (this ->value ());
33+ }
34+
35+ inline Object::operator bool () const
36+ {
37+ return this ->test ();
38+ }
39+
40+ inline bool Object::is_nil () const
41+ {
42+ return NIL_P (this ->value ());
43+ }
44+
45+ inline Object::operator VALUE () const
46+ {
47+ return this ->value ();
48+ }
49+
50+ inline VALUE Object::value () const
51+ {
52+ return this ->value_ ;
53+ }
54+
3055 template <typename ...Parameter_Ts>
3156 inline Object Object::call (Identifier id, Parameter_Ts... args) const
3257 {
@@ -63,13 +88,13 @@ namespace Rice
6388
6489 inline bool Object::is_equal (const Object& other) const
6590 {
66- VALUE result = detail::protect (rb_equal, this ->value_ , other.value_ );
91+ VALUE result = detail::protect (rb_equal, this ->value () , other.value () );
6792 return RB_TEST (result);
6893 }
6994
7095 inline bool Object::is_eql (const Object& other) const
7196 {
72- VALUE result = detail::protect (rb_eql, this ->value_ , other.value_ );
97+ VALUE result = detail::protect (rb_eql, this ->value () , other.value () );
7398 return RB_TEST (result);
7499 }
75100
@@ -125,9 +150,9 @@ namespace Rice
125150 return detail::protect (rb_attr_get, this ->value (), name.id ());
126151 }
127152
128- inline void Object::set_value (VALUE v )
153+ inline void Object::set_value (VALUE value )
129154 {
130- value_ = v ;
155+ value_ = value ;
131156 }
132157
133158 inline Object Object::const_get (Identifier name) const
0 commit comments