Class: Tomahawk::DirectiveGroups::Base
- Inherits:
-
Object
- Object
- Tomahawk::DirectiveGroups::Base
- Defined in:
- lib/tomahawk/directive_groups/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#directives ⇒ Object
Returns the value of attribute directives.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#parameters ⇒ Object
Returns the value of attribute parameters.
Instance Method Summary collapse
- #==(obj) ⇒ Object
-
#initialize(parameters = '', directives = {}, groups = []) {|directives, groups| ... } ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(parameters = '', directives = {}, groups = []) {|directives, groups| ... } ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/tomahawk/directive_groups/base.rb', line 6 def initialize(parameters = '', directives = {}, groups = []) yield(directives, groups) if block_given? @parameters = parameters @directives = Hash[directives] @groups = Array(groups) end |
Instance Attribute Details
#directives ⇒ Object
Returns the value of attribute directives.
4 5 6 |
# File 'lib/tomahawk/directive_groups/base.rb', line 4 def directives @directives end |
#groups ⇒ Object
Returns the value of attribute groups.
4 5 6 |
# File 'lib/tomahawk/directive_groups/base.rb', line 4 def groups @groups end |
#parameters ⇒ Object
Returns the value of attribute parameters.
4 5 6 |
# File 'lib/tomahawk/directive_groups/base.rb', line 4 def parameters @parameters end |
Instance Method Details
#==(obj) ⇒ Object
21 22 23 24 25 |
# File 'lib/tomahawk/directive_groups/base.rb', line 21 def ==(obj) self.class == self.class && self.parameters == obj.parameters && self.directives == obj.directives && self.groups == obj.groups rescue false end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/tomahawk/directive_groups/base.rb', line 17 def to_s to_str end |
#to_str ⇒ Object
13 14 15 |
# File 'lib/tomahawk/directive_groups/base.rb', line 13 def to_str raise "#{self.class.name} doesn't support #conf!" end |