Class: SBConstants::Section

Inherits:
Struct
  • Object
show all
Defined in:
lib/sbconstants/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#constantsObject

Returns the value of attribute constants

Returns:

  • (Object)

    the current value of constants



2
3
4
# File 'lib/sbconstants/section.rb', line 2

def constants
  @constants
end

#locationsObject

Returns the value of attribute locations

Returns:

  • (Object)

    the current value of locations



2
3
4
# File 'lib/sbconstants/section.rb', line 2

def locations
  @locations
end

Instance Method Details

#pretty_titleObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/sbconstants/section.rb', line 4

def pretty_title
  title = locations.map(&:key_path).join('')
                           .gsub(".", "")
                           .gsub(" ", "")
                           .gsub("identifier", "Identifier")
                           .gsub("viewcontroller", "ViewController")
                           .gsub("storyboard", "Storyboard")

  title.slice(0,1).capitalize + title.slice(1..-1)
end