Class: ActiveCMIS::AtomicType::Boolean

Inherits:
Singleton show all
Defined in:
lib/active_cmis/atomic_types.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Singleton

new

Methods inherited from CommonBase

#cmis2rb, #rb2cmis

Class Method Details

.xml_to_bool(value) ⇒ Object



149
150
151
152
153
154
155
# File 'lib/active_cmis/atomic_types.rb', line 149

def self.xml_to_bool(value)
  case value
  when "true", "1"; true
  when "false", "0"; false
  else raise ActiveCMIS::Error.new("An invalid boolean was found in CMIS")
  end
end

Instance Method Details

#can_handle?(value) ⇒ Boolean

Returns:



167
168
169
# File 'lib/active_cmis/atomic_types.rb', line 167

def can_handle?(value)
  [true, false].include?(value)
end

#to_sObject



157
158
159
# File 'lib/active_cmis/atomic_types.rb', line 157

def to_s
  "Boolean"
end