lib/yard/code_objects/method_object.rb in yard-0.5.5 vs lib/yard/code_objects/method_object.rb in yard-0.5.6

- old
+ new

@@ -2,16 +2,16 @@ # Represents a Ruby method in source class MethodObject < Base # The visibility of the method (+:public:+, +:protected+, +:private+) # # @return [Symbol] the method visibility - attr_accessor :visibility + attr_reader :visibility # The scope of the method (+:class+ or +:instance+) # # @return [Symbol] the scope - attr_accessor :scope + attr_reader :scope # Whether the object is explicitly defined in source or whether it was # inferred by a handler. For instance, attribute methods are generally # inferred and therefore not explicitly defined in source. # @@ -30,9 +30,10 @@ # # @param [NamespaceObject] namespace the namespace # @param [String, Symbol] name the method name # @param [Symbol] scope +:instance+ or +:class+ def initialize(namespace, name, scope = :instance) + @scope = nil self.visibility = :public self.scope = scope self.parameters = [] super