Class: Holistic::Ruby::Scope::Location::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/holistic/ruby/scope/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope_name) ⇒ Collection

Returns a new instance of Collection.



8
9
10
11
# File 'lib/holistic/ruby/scope/location.rb', line 8

def initialize(scope_name)
  @scope_name = scope_name
  @items = []
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



6
7
8
# File 'lib/holistic/ruby/scope/location.rb', line 6

def items
  @items
end

#scope_nameObject (readonly)

Returns the value of attribute scope_name.



6
7
8
# File 'lib/holistic/ruby/scope/location.rb', line 6

def scope_name
  @scope_name
end

Instance Method Details

#mainObject



13
14
15
# File 'lib/holistic/ruby/scope/location.rb', line 13

def main
  location_matching_scope_name || items.first
end