Class: Malline::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/malline/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandler

Returns a new instance of Handler.



5
6
7
# File 'lib/malline/handler.rb', line 5

def initialize
  @parsed = []
end

Instance Attribute Details

#parsedObject (readonly)

Returns the value of attribute parsed.



3
4
5
# File 'lib/malline/handler.rb', line 3

def parsed
  @parsed
end

#token_lineObject

Returns the value of attribute token_line.



4
5
6
# File 'lib/malline/handler.rb', line 4

def token_line
  @token_line
end

Instance Method Details

#code(string, cmd = nil) ⇒ Object



9
10
11
# File 'lib/malline/handler.rb', line 9

def code string, cmd=nil
  @parsed << [:code, cmd, string, token_line]
end

#data(string) ⇒ Object



13
14
15
# File 'lib/malline/handler.rb', line 13

def data string
  @parsed << [:data, string, token_line]
end