Class: Docopt::ParentPattern
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
Instance Method Summary collapse
- #flat ⇒ Object
-
#initialize(*children) ⇒ ParentPattern
constructor
A new instance of ParentPattern.
- #inspect ⇒ Object
Methods inherited from Pattern
#==, #dump, #either, #fix, #fix_identities, #fix_list_arguments, #to_str
Constructor Details
#initialize(*children) ⇒ ParentPattern
Returns a new instance of ParentPattern.
163 164 165 |
# File 'lib/docopt.rb', line 163 def initialize(*children) @children = children end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
161 162 163 |
# File 'lib/docopt.rb', line 161 def children @children end |
Instance Method Details
#flat ⇒ Object
172 173 174 |
# File 'lib/docopt.rb', line 172 def flat self.children.map { |c| c.flat }.flatten end |
#inspect ⇒ Object
167 168 169 170 |
# File 'lib/docopt.rb', line 167 def inspect childstr = self.children.map { |a| a.inspect } return "#{self.class.name}(#{childstr.join(", ")})" end |