Class: Jazzy::SourceDeclaration::AccessControlLevel
- Inherits:
-
Object
- Object
- Jazzy::SourceDeclaration::AccessControlLevel
- Includes:
- Comparable
- Defined in:
- lib/jazzy/source_declaration/access_control_level.rb
Constant Summary collapse
- LEVELS =
{ private: 0, internal: 1, public: 2, }.freeze
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(declaration_string) ⇒ AccessControlLevel
constructor
A new instance of AccessControlLevel.
Constructor Details
#initialize(declaration_string) ⇒ AccessControlLevel
Returns a new instance of AccessControlLevel.
8 9 10 11 12 13 14 15 16 |
# File 'lib/jazzy/source_declaration/access_control_level.rb', line 8 def initialize(declaration_string) if declaration_string =~ /private\ / @level = :private elsif declaration_string =~ /public\ / @level = :public else @level = :internal end end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
6 7 8 |
# File 'lib/jazzy/source_declaration/access_control_level.rb', line 6 def level @level end |
Class Method Details
.internal ⇒ Object
22 23 24 |
# File 'lib/jazzy/source_declaration/access_control_level.rb', line 22 def self.internal AccessControlLevel.new('internal ') end |
.private ⇒ Object
18 19 20 |
# File 'lib/jazzy/source_declaration/access_control_level.rb', line 18 def self.private AccessControlLevel.new('private ') end |
.public ⇒ Object
26 27 28 |
# File 'lib/jazzy/source_declaration/access_control_level.rb', line 26 def self.public AccessControlLevel.new('public ') end |