lib/bindata/sanitize.rb in bindata-1.8.3 vs lib/bindata/sanitize.rb in bindata-2.0.0
- old
+ new
@@ -22,18 +22,10 @@
@obj_class = obj_class
@obj_params = SanitizedParameters.new(obj_params, @obj_class, endian)
end
end
- def has_parameter?(param)
- if @factory
- @factory.has_parameter?(param)
- else
- @obj_params.has_parameter?(param)
- end
- end
-
def instantiate(value = nil, parent = nil)
@factory ||= @obj_class.new(@obj_params)
@factory.new(value, parent)
end
@@ -54,14 +46,10 @@
def name
@name
end
- def has_parameter?(param)
- @prototype.has_parameter?(param)
- end
-
def instantiate(value = nil, parent = nil)
@prototype.instantiate(value, parent)
end
end
#----------------------------------------------------------------------------
@@ -93,14 +81,10 @@
def each(&block)
@fields.each(&block)
end
- def each_with_index(&block)
- @fields.each_with_index(&block)
- end
-
def collect(&block)
@fields.collect(&block)
end
def field_names
@@ -115,13 +99,9 @@
@fields.all? { |f| f.name == nil }
end
def no_field_names_blank?
@fields.all? { |f| f.name != nil }
- end
-
- def any_field_has_parameter?(parameter)
- @fields.any? { |f| f.has_parameter?(parameter) }
end
def copy_fields(other)
@fields.concat(other.fields)
end