lib/object.rb in machinery-tool-1.8.2 vs lib/object.rb in machinery-tool-1.9.0
- old
+ new
@@ -53,12 +53,20 @@
new(json_object)
end
end
attr_reader :attributes
+ attr_accessor :scope
def initialize(attrs = {})
set_attributes(attrs)
+ end
+
+ def scope=(scope)
+ @scope = scope
+ @attributes.values.each do |child|
+ child.scope = @scope if child.respond_to?(:scope=)
+ end
end
def set_attributes(attrs)
attrs = self.class.convert_raw_hash(attrs) if attrs.is_a?(Hash)
@attributes = attrs.inject({}) do |attributes, (key, value)|