Module: Betterdocs::Dsl::Naming
- Included in:
- JsonParams::Param, Result::Link, Result::Property
- Defined in:
- lib/betterdocs/dsl/naming.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #below_path(path) ⇒ Object
- #full_name ⇒ Object
- #initialize ⇒ Object
- #nesting_name ⇒ Object
- #path ⇒ Object
- #public_name ⇒ Object
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/betterdocs/dsl/naming.rb', line 8 def @options end |
Instance Method Details
#below_path(path) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/betterdocs/dsl/naming.rb', line 14 def below_path(path) dup.instance_eval do @below_path = path self end end |
#full_name ⇒ Object
25 26 27 |
# File 'lib/betterdocs/dsl/naming.rb', line 25 def full_name path * '.' end |
#initialize ⇒ Object
2 3 4 5 6 |
# File 'lib/betterdocs/dsl/naming.rb', line 2 def initialize(*) super @options ||= {} @below_path = [] end |
#nesting_name ⇒ Object
29 30 31 |
# File 'lib/betterdocs/dsl/naming.rb', line 29 def nesting_name @below_path * '.' end |
#path ⇒ Object
10 11 12 |
# File 'lib/betterdocs/dsl/naming.rb', line 10 def path @below_path + [ public_name ] end |
#public_name ⇒ Object
21 22 23 |
# File 'lib/betterdocs/dsl/naming.rb', line 21 def public_name @options[:as] || name end |