Class: CabezaDeTermo::JsonSpec::ExpectationMessagesMapping

Inherits:
Object
  • Object
show all
Defined in:
lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb

Instance Method Summary collapse

Constructor Details

#initializeExpectationMessagesMapping

Returns a new instance of ExpectationMessagesMapping.



4
5
6
# File 'lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb', line 4

def initialize()
	@messages = {}
end

Instance Method Details

#define_message_formatter_for(expectation_method, message_block) ⇒ Object



20
21
22
23
24
# File 'lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb', line 20

def define_message_formatter_for(expectation_method, message_block)
	messages[expectation_method.to_sym] = message_block

	self
end

#has_message_formatter_for?(expectation_method) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb', line 16

def has_message_formatter_for?(expectation_method)
	messages.key?(expectation_method.to_sym)
end

#message_formatter_for(expectation_method) ⇒ Object



12
13
14
# File 'lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb', line 12

def message_formatter_for(expectation_method)
	messages[expectation_method.to_sym]
end

#messagesObject



8
9
10
# File 'lib/cabeza-de-termo/json-spec/expectations-library/messages/expectation-messages-mapping.rb', line 8

def messages
	@messages
end