Class: HumanPower::Rule
- Inherits:
-
Object
- Object
- HumanPower::Rule
- Defined in:
- lib/human_power/rule.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, path) ⇒ Rule
constructor
A new instance of Rule.
- #render ⇒ Object (also: #to_s)
Constructor Details
#initialize(type, path) ⇒ Rule
Returns a new instance of Rule.
5 6 7 8 |
# File 'lib/human_power/rule.rb', line 5 def initialize(type, path) @type = type @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/human_power/rule.rb', line 3 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/human_power/rule.rb', line 3 def type @type end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/human_power/rule.rb', line 16 def ==(other) other.type == type && other.path == path end |
#render ⇒ Object Also known as: to_s
10 11 12 |
# File 'lib/human_power/rule.rb', line 10 def render "#{type.to_s.capitalize}: #{path}" end |