Class: Origen::Features::Feature

Inherits:
Object
  • Object
show all
Defined in:
lib/origen/features/feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Feature

Returns a new instance of Feature.



7
8
9
10
# File 'lib/origen/features/feature.rb', line 7

def initialize(name, options = {})
  @name = name
  @description = options[:description]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/origen/features/feature.rb', line 5

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/origen/features/feature.rb', line 4

def name
  @name
end

Instance Method Details

#describeObject



12
13
14
15
16
17
18
19
20
# File 'lib/origen/features/feature.rb', line 12

def describe
  return 'No description provided!' if @description == []

  if @description.class == Array
    @description.join(' ')
  else
    @description
  end
end