Module: Hexp::CssSelector::Members
- Extended by:
- Forwardable
- Included in:
- CommaSequence, Sequence, SimpleSequence
- Defined in:
- lib/hexp/css_selector.rb
Overview
Common behavior for parse tree nodes based on a list of members
Instance Attribute Summary collapse
-
#members ⇒ Array
readonly
private
Member nodes.
Class Method Summary collapse
-
.included(klass) ⇒ Object
private
Create a class level collection constructor.
Instance Method Summary collapse
-
#initialize(members) ⇒ Object
private
Shared initializer for parse tree nodes with children (members).
-
#inspect ⇒ String
private
Return a debugging representation.
Instance Attribute Details
#members ⇒ Array (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Member nodes
16 17 18 |
# File 'lib/hexp/css_selector.rb', line 16 def members @members end |
Class Method Details
.included(klass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a class level collection constructor
33 34 35 36 37 38 |
# File 'lib/hexp/css_selector.rb', line 33 def self.included(klass) super def klass.[](*members) new(members) end end |
Instance Method Details
#initialize(members) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Shared initializer for parse tree nodes with children (members)
21 22 23 |
# File 'lib/hexp/css_selector.rb', line 21 def initialize(members) @members = members end |
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return a debugging representation
45 46 47 |
# File 'lib/hexp/css_selector.rb', line 45 def inspect "#{self.class.name.split('::').last}[#{self.members.map(&:inspect).join(', ')}]" end |