Class: Maven::Parameter
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#directly_editable ⇒ Object
Returns the value of attribute directly_editable.
-
#index ⇒ Object
Returns the value of attribute index.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(parent) ⇒ Parameter
constructor
A new instance of Parameter.
- #process(line) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(parent) ⇒ Parameter
Returns a new instance of Parameter.
382 383 384 |
# File 'lib/maven.rb', line 382 def initialize(parent) @parent = parent end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
379 380 381 |
# File 'lib/maven.rb', line 379 def description @description end |
#directly_editable ⇒ Object
Returns the value of attribute directly_editable.
380 381 382 |
# File 'lib/maven.rb', line 380 def directly_editable @directly_editable end |
#index ⇒ Object
Returns the value of attribute index.
380 381 382 |
# File 'lib/maven.rb', line 380 def index @index end |
#name ⇒ Object
Returns the value of attribute name.
379 380 381 |
# File 'lib/maven.rb', line 379 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
380 381 382 |
# File 'lib/maven.rb', line 380 def required @required end |
#type ⇒ Object
Returns the value of attribute type.
380 381 382 |
# File 'lib/maven.rb', line 380 def type @type end |
Instance Method Details
#process(line) ⇒ Object
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/maven.rb', line 386 def process(line) return parent if /^#{'=' * 40}/ =~ line case @status || :none when :none if /\[(\d+?)\] Name: (.*)/ =~ line @index = $1.to_i @name = $2.strip @status = :attributes end self when :attributes self.until(line, /^Description\:/, :description) do key, value = *line.split(':', 2) words = *key.split(' ') send("#{words.map{|s|s.downcase}.join('_')}=", value.strip) end self when :description if /^#{'-' * 40}/ =~ line parent.new_parameter else self.description ||= [] self.description << line.strip self end else raise "unimplemented" end end |