Class: Mulang::Expectation::Custom

Inherits:
Object
  • Object
show all
Defined in:
lib/mulang/expectation/custom.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject

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

Returns:

  • (Boolean)


30
31
32
# File 'lib/mulang/expectation/custom.rb', line 30

def self.valid?(_)
  true
end

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/mulang/expectation/custom.rb', line 18

def custom?
  true
end

#standard?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/mulang/expectation/custom.rb', line 22

def standard?
  false
end

#to_hObject



14
15
16
# File 'lib/mulang/expectation/custom.rb', line 14

def to_h
  {binding: '<<custom>>', inspection: name}
end

#translateObject Also known as: translate!



8
9
10
# File 'lib/mulang/expectation/custom.rb', line 8

def translate(*)
  name
end