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



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

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)


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

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