Class: Vim::Netbeans::Event

Inherits:
Message
  • Object
show all
Defined in:
lib/vim/netbeans.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#message

Instance Method Summary collapse

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(message)
  super
  if match = message.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

#bufferObject (readonly)

Returns the value of attribute buffer.



17
18
19
# File 'lib/vim/netbeans.rb', line 17

def buffer
  @buffer
end

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/vim/netbeans.rb', line 17

def name
  @name
end

#restObject (readonly)

Returns the value of attribute rest.



17
18
19
# File 'lib/vim/netbeans.rb', line 17

def rest
  @rest
end

#valueObject (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_sObject



41
42
43
# File 'lib/vim/netbeans.rb', line 41

def to_s
  %Q~#{@buffer}:#{@name}=#{@value} #{@rest.inspect}~
end