Class: Sin

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, begin_line, begin_char, end_line, end_char) ⇒ Sin

Returns a new instance of Sin.



4
5
6
7
8
9
10
# File 'lib/sin/sin.rb', line 4

def initialize(type, begin_line, begin_char, end_line, end_char)
  @type = type
  @begin_line = begin_line
  @begin_char = begin_char
  @end_line = end_line
  @end_char = end_char
end

Instance Attribute Details

#begin_charObject

Returns the value of attribute begin_char.



2
3
4
# File 'lib/sin/sin.rb', line 2

def begin_char
  @begin_char
end

#begin_lineObject

Returns the value of attribute begin_line.



2
3
4
# File 'lib/sin/sin.rb', line 2

def begin_line
  @begin_line
end

#end_charObject

Returns the value of attribute end_char.



2
3
4
# File 'lib/sin/sin.rb', line 2

def end_char
  @end_char
end

#end_lineObject

Returns the value of attribute end_line.



2
3
4
# File 'lib/sin/sin.rb', line 2

def end_line
  @end_line
end

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/sin/sin.rb', line 2

def type
  @type
end

Instance Method Details

#==(other_object) ⇒ Object



16
17
18
# File 'lib/sin/sin.rb', line 16

def ==(other_object)
  @type == other_object.type && @begin_line == other_object.begin_line && @begin_char == other_object.begin_char && @end_line == other_object.end_line && @end_char == other_object.end_char
end

#ToStringObject



12
13
14
# File 'lib/sin/sin.rb', line 12

def ToString
  return "<Sin:#{@type[:name]}, Line:#{@begin_line}, Char:#{@begin_char}, Message:#{@type[:message]}, Recommendation:#{@type[:solution]}>"
end