Class: GemfileSorter::Line::Source
- Inherits:
-
BlockOfGems
- Object
- BlockOfGems
- GemfileSorter::Line::Source
- Defined in:
- lib/gemfile_sorter/line/source.rb
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from BlockOfGems
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #container? ⇒ Boolean
-
#initialize(name, line:, line_number:) ⇒ Source
constructor
A new instance of Source.
- #inside_block_map ⇒ Object
- #normalized_name ⇒ Object
Methods inherited from BlockOfGems
#add, #empty?, #gem_string, #leading_spaces, #to_s
Constructor Details
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
4 5 6 |
# File 'lib/gemfile_sorter/line/source.rb', line 4 def groups @groups end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/gemfile_sorter/line/source.rb', line 4 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 21 22 |
# File 'lib/gemfile_sorter/line/source.rb', line 18 def <=>(other) name <=> other.name rescue raise InvalidLineComparisonError end |
#container? ⇒ Boolean
12 |
# File 'lib/gemfile_sorter/line/source.rb', line 12 def container? = true |
#inside_block_map ⇒ Object
14 |
# File 'lib/gemfile_sorter/line/source.rb', line 14 def inside_block_map = groups |
#normalized_name ⇒ Object
16 |
# File 'lib/gemfile_sorter/line/source.rb', line 16 def normalized_name = name |