Class: XDry::CompoundSelectorDef
- Inherits:
-
SelectorDef
- Object
- SelectorDef
- XDry::CompoundSelectorDef
- Defined in:
- lib/xdry/parsing/parts/selectors.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Instance Method Summary collapse
-
#initialize(components) ⇒ CompoundSelectorDef
constructor
A new instance of CompoundSelectorDef.
- #selector ⇒ Object
- #simple? ⇒ Boolean
- #to_s ⇒ Object
- #var_name_after_keyword(keyword) ⇒ Object
Methods inherited from SelectorDef
Constructor Details
#initialize(components) ⇒ CompoundSelectorDef
Returns a new instance of CompoundSelectorDef.
92 93 94 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 92 def initialize components @components = components.freeze end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
90 91 92 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 90 def components @components end |
Instance Method Details
#selector ⇒ Object
96 97 98 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 96 def selector @selector ||= @components.collect { |comp| comp.keyword }.join("") end |
#simple? ⇒ Boolean
100 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 100 def simple?; false; end |
#to_s ⇒ Object
102 103 104 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 102 def to_s @components.collect { |comp| comp.to_s }.join(" ") end |
#var_name_after_keyword(keyword) ⇒ Object
106 107 108 109 |
# File 'lib/xdry/parsing/parts/selectors.rb', line 106 def var_name_after_keyword keyword comp = @components.find { |comp| comp.keyword == keyword } comp && comp.arg_name end |