Module: Betterdocs::Dsl::Naming

Included in:
JsonParams::Param, Result::Link, Result::Property
Defined in:
lib/betterdocs/dsl/naming.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/betterdocs/dsl/naming.rb', line 8

def options
  @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_nameObject



25
26
27
# File 'lib/betterdocs/dsl/naming.rb', line 25

def full_name
  path * '.'
end

#initializeObject



2
3
4
5
6
# File 'lib/betterdocs/dsl/naming.rb', line 2

def initialize(*)
  super
  @options ||= {}
  @below_path = []
end

#nesting_nameObject



29
30
31
# File 'lib/betterdocs/dsl/naming.rb', line 29

def nesting_name
  @below_path * '.'
end

#pathObject



10
11
12
# File 'lib/betterdocs/dsl/naming.rb', line 10

def path
  @below_path + [ public_name ]
end

#public_nameObject



21
22
23
# File 'lib/betterdocs/dsl/naming.rb', line 21

def public_name
  @options[:as] || name
end