Class: ASAutotest::Type

Inherits:
Object
  • Object
show all
Extended by:
Bracketable
Defined in:
lib/asautotest/problematic-file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Bracketable

[]

Constructor Details

#initialize(package, name) ⇒ Type

Returns a new instance of Type.



119
120
121
122
# File 'lib/asautotest/problematic-file.rb', line 119

def initialize(package, name)
  @package = package
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



118
119
120
# File 'lib/asautotest/problematic-file.rb', line 118

def name
  @name
end

#packageObject (readonly)

Returns the value of attribute package.



118
119
120
# File 'lib/asautotest/problematic-file.rb', line 118

def package
  @package
end

Class Method Details

.parse(input) ⇒ Object



124
125
126
127
128
129
130
131
# File 'lib/asautotest/problematic-file.rb', line 124

def self.parse(input)
  case input
  when /^(.*):(.*)$/
    Type[$1, $2]
  else
    Type[nil, input]
  end
end

Instance Method Details

#==(other) ⇒ Object



141
142
143
# File 'lib/asautotest/problematic-file.rb', line 141

def == other
  package == other.package and name == other.name
end

#full_nameObject



137
138
139
# File 'lib/asautotest/problematic-file.rb', line 137

def full_name
  "#{package}.#{name}"
end

#to_sObject



133
134
135
# File 'lib/asautotest/problematic-file.rb', line 133

def to_s
  name ? name : package
end