Module: Origen::Features

Extended by:
ActiveSupport::Concern
Defined in:
lib/origen/features.rb,
lib/origen/features/feature.rb

Defined Under Namespace

Modules: ClassMethods Classes: Feature

Instance Method Summary collapse

Instance Method Details

#feature(name = nil) ⇒ Object Also known as: features

Returns an array of the names of all associated features


91
92
93
94
95
96
97
98
99
100
101
# File 'lib/origen/features.rb', line 91

def feature(name = nil)
  if !name
    self.class.features.keys
  else
    if self.class.features.key?(name)
      self.class.features[name]
    else
      fail "Feature #{name} does not exist!"
    end
  end
end

#has_features?(name = nil) ⇒ Boolean Also known as: has_feature?

Returns:

  • (Boolean)

77
78
79
80
81
82
83
84
85
86
87
# File 'lib/origen/features.rb', line 77

def has_features?(name = nil)
  if !name
    if feature.size == 0
      return false
    else
      return true
    end
  else
    return feature.include?(name)
  end
end