Module: Rubyzen::Providers::VisibilityProvider

Included in:
Declarations::AttributeDeclaration, Declarations::MethodDeclaration
Defined in:
lib/rubyzen/providers/visibility_provider.rb

Overview

Provides method visibility detection (public, private, protected).

Instance Method Summary collapse

Instance Method Details

#private?Boolean

Returns true if this declaration is private.

Returns:

  • (Boolean)

    true if this declaration is private



11
12
13
# File 'lib/rubyzen/providers/visibility_provider.rb', line 11

def private?
  visibility == :private
end

#protected?Boolean

Returns true if this declaration is protected.

Returns:

  • (Boolean)

    true if this declaration is protected



16
17
18
# File 'lib/rubyzen/providers/visibility_provider.rb', line 16

def protected?
  visibility == :protected
end

#public?Boolean

Returns true if this declaration is public.

Returns:

  • (Boolean)

    true if this declaration is public



21
22
23
# File 'lib/rubyzen/providers/visibility_provider.rb', line 21

def public?
  visibility == :public
end

#visibilitySymbol

Returns the visibility of this declaration (:public, :private, or :protected).

Returns:

  • (Symbol)

    the visibility of this declaration (:public, :private, or :protected)



6
7
8
# File 'lib/rubyzen/providers/visibility_provider.rb', line 6

def visibility
  determine_visibility
end