Class: VhdlDoctest::Types::StdLogic

Inherits:
Object
  • Object
show all
Defined in:
lib/vhdl_doctest/types/std_logic.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(str) ⇒ Object



16
17
18
# File 'lib/vhdl_doctest/types/std_logic.rb', line 16

def self.parse(str)
  new if str.strip.downcase == 'std_logic'
end

Instance Method Details

#format(v) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/vhdl_doctest/types/std_logic.rb', line 7

def format(v)
  if [0, 1].include? v.to_i
    %Q{'#{v.to_i}'}
  else
    # TODO: define error class
    raise "unacceptable value error #{v}"
  end
end

#to_vhdlObject



3
4
5
# File 'lib/vhdl_doctest/types/std_logic.rb', line 3

def to_vhdl
  'std_logic'
end