Module: Kali::Utils::Named
- Included in:
- Component, KeyValuePair
- Defined in:
- lib/kali/utils/named.rb
Instance Method Summary collapse
-
#method_name ⇒ Object
Public: Get a default name for the method used as an accessor for this property, based on the name of the property.
-
#name(name = nil) ⇒ Object
Public: Get/Set the name of the property implemented by this class.
Instance Method Details
#method_name ⇒ Object
Public: Get a default name for the method used as an accessor for this property, based on the name of the property.
12 13 14 |
# File 'lib/kali/utils/named.rb', line 12 def method_name @method_name ||= name.to_s.downcase.gsub("-", "_") unless name.nil? end |
#name(name = nil) ⇒ Object
Public: Get/Set the name of the property implemented by this class.
5 6 7 8 |
# File 'lib/kali/utils/named.rb', line 5 def name(name = nil) @name = name if name @name end |