Class: Vim::Netbeans::Event
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rest ⇒ Object
readonly
Returns the value of attribute rest.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(message) ⇒ Event
constructor
A new instance of Event.
- #to_s ⇒ Object
Constructor Details
#initialize(message) ⇒ Event
Returns a new instance of Event.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vim/netbeans.rb', line 18 def initialize() super if match = .match(/^(\d+):(\w+)=(\d)\s*/) @buffer = match[1].to_i @name = match[2] @value = match[3] @rest = match.post_match.split(/\s/) @rest = @rest.map do |arg| case arg when /^"(.*)"$/ $1 when 'T' true when 'F' false when /^\d+$/ arg.to_i else arg end end end end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
17 18 19 |
# File 'lib/vim/netbeans.rb', line 17 def buffer @buffer end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/vim/netbeans.rb', line 17 def name @name end |
#rest ⇒ Object (readonly)
Returns the value of attribute rest.
17 18 19 |
# File 'lib/vim/netbeans.rb', line 17 def rest @rest end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
17 18 19 |
# File 'lib/vim/netbeans.rb', line 17 def value @value end |
Instance Method Details
#to_s ⇒ Object
41 42 43 |
# File 'lib/vim/netbeans.rb', line 41 def to_s %Q~#{@buffer}:#{@name}=#{@value} #{@rest.inspect}~ end |