Method: CLURef#initialize
- Defined in:
- lib/types/cl_uref.rb
#initialize(value = nil, access_rights = nil) ⇒ CLURef
value is an uint8array
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/types/cl_uref.rb', line 17 def initialize(value = nil, access_rights = nil) super() # raise ArgumentError.new('The length of URefAddr should be 32') unless value.length == 32 # rescue ArgumentError => e # p e.message begin raise ArgumentError.new('The length of URefAddr should be 32') unless value.length == 32 rescue ArgumentError => e e. end begin raise ArgumentError.new('Unsupported AccessRights') unless AccessRights.has_value?(access_rights) rescue ArgumentError => e e. end # if value.length != 32 # raise ArgumentError.new('The length of URefAddr should be 32') # end # raise ArgumentError.new("Unsupported AccessRights") unless AccessRights.has_value?(access_rights) # if value.length != 32 # begin # raise Error.new('The length of URefAddr should be 32') # rescue StandardError => e # puts e # end # end # if !(AccessRights.has_value?(access_rights)) # raise Error.new('Unsupported AccessRights') # end @value = value @access_rights = access_rights end |