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
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
24 25 26 |
# File 'lib/mulang/expectation/custom.rb', line 24 def self.parse(expectation) new expectation[:inspection] end |
.valid?(_) ⇒ Boolean
28 29 30 |
# File 'lib/mulang/expectation/custom.rb', line 28 def self.valid?(_) true end |
Instance Method Details
#custom? ⇒ Boolean
16 17 18 |
# File 'lib/mulang/expectation/custom.rb', line 16 def custom? true end |
#standard? ⇒ Boolean
20 21 22 |
# File 'lib/mulang/expectation/custom.rb', line 20 def standard? false end |
#to_h ⇒ Object
12 13 14 |
# File 'lib/mulang/expectation/custom.rb', line 12 def to_h {binding: '<<custom>>', inspection: name} end |
#translate ⇒ Object
8 9 10 |
# File 'lib/mulang/expectation/custom.rb', line 8 def translate(*) name end |