Class: Rubble::Target::Base
- Inherits:
-
Object
- Object
- Rubble::Target::Base
- Defined in:
- lib/rubble/target/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Base
constructor
A new instance of Base.
- #suffix ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(name) ⇒ Base
Returns a new instance of Base.
10 11 12 13 |
# File 'lib/rubble/target/base.rb', line 10 def initialize(name) @name = name @service = "#{self.class.name.downcase.split(/::/).last}#{suffix}" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/rubble/target/base.rb', line 7 def name @name end |
Instance Method Details
#suffix ⇒ Object
19 20 21 |
# File 'lib/rubble/target/base.rb', line 19 def suffix (name == :default) ? '' : "-#{name}" end |
#type ⇒ Object
15 16 17 |
# File 'lib/rubble/target/base.rb', line 15 def type self.class.name.downcase.to_sym end |