Class: Hessian2::TypeWrapper
- Inherits:
-
Object
- Object
- Hessian2::TypeWrapper
- Defined in:
- lib/hessian2/type_wrapper.rb
Instance Attribute Summary collapse
-
#hessian_type ⇒ Object
readonly
Returns the value of attribute hessian_type.
-
#is_multi ⇒ Object
readonly
Returns the value of attribute is_multi.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(type, object) ⇒ TypeWrapper
constructor
A new instance of TypeWrapper.
- #is_multi? ⇒ Boolean
Constructor Details
#initialize(type, object) ⇒ TypeWrapper
Returns a new instance of TypeWrapper.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hessian2/type_wrapper.rb', line 6 def initialize(type, object) if type.is_a?(Array) is_multi = true hessian_type = unify_type(type.first) elsif type.is_a?(String) if type.include?('[') is_multi = true hessian_type = unify_type(type.delete('[]')) else is_multi = false hessian_type = unify_type(type) end else is_multi = false hessian_type = unify_type(type) end @object, @hessian_type, @is_multi = object, hessian_type, is_multi end |
Instance Attribute Details
#hessian_type ⇒ Object (readonly)
Returns the value of attribute hessian_type.
4 5 6 |
# File 'lib/hessian2/type_wrapper.rb', line 4 def hessian_type @hessian_type end |
#is_multi ⇒ Object (readonly)
Returns the value of attribute is_multi.
4 5 6 |
# File 'lib/hessian2/type_wrapper.rb', line 4 def is_multi @is_multi end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/hessian2/type_wrapper.rb', line 3 def object @object end |
Instance Method Details
#is_multi? ⇒ Boolean
27 28 29 |
# File 'lib/hessian2/type_wrapper.rb', line 27 def is_multi? @is_multi end |