Class: Mulang::Expectation::Custom
- Inherits:
-
Object
- Object
- Mulang::Expectation::Custom
- Defined in:
- lib/mulang/expectation/custom.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #custom? ⇒ Boolean
-
#initialize(name) ⇒ Custom
constructor
A new instance of Custom.
- #standard? ⇒ Boolean
- #to_h ⇒ Object
- #translate ⇒ Object (also: #translate!)
Constructor Details
#initialize(name) ⇒ Custom
Returns a new instance of Custom.
4 5 6 |
# File 'lib/mulang/expectation/custom.rb', line 4 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/mulang/expectation/custom.rb', line 2 def name @name end |
Class Method Details
.parse(expectation) ⇒ Object
26 27 28 |
# File 'lib/mulang/expectation/custom.rb', line 26 def self.parse(expectation) new expectation[:inspection] end |
.valid?(_) ⇒ Boolean
30 31 32 |
# File 'lib/mulang/expectation/custom.rb', line 30 def self.valid?(_) true end |
Instance Method Details
#custom? ⇒ Boolean
18 19 20 |
# File 'lib/mulang/expectation/custom.rb', line 18 def custom? true end |
#standard? ⇒ Boolean
22 23 24 |
# File 'lib/mulang/expectation/custom.rb', line 22 def standard? false end |
#to_h ⇒ Object
14 15 16 |
# File 'lib/mulang/expectation/custom.rb', line 14 def to_h {binding: '<<custom>>', inspection: name} end |
#translate ⇒ Object Also known as: translate!
8 9 10 |
# File 'lib/mulang/expectation/custom.rb', line 8 def translate(*) name end |