Class: PactBroker::Contracts::Notice

Inherits:
Struct
  • Object
show all
Defined in:
lib/pact_broker/contracts/notice.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



3
4
5
# File 'lib/pact_broker/contracts/notice.rb', line 3

def text
  @text
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/pact_broker/contracts/notice.rb', line 3

def type
  @type
end

Class Method Details

.debug(text) ⇒ Object



8
9
10
# File 'lib/pact_broker/contracts/notice.rb', line 8

def self.debug(text)
  Notice.new("debug", text)
end

.error(text) ⇒ Object



24
25
26
# File 'lib/pact_broker/contracts/notice.rb', line 24

def self.error(text)
  Notice.new("error", text)
end

.info(text) ⇒ Object



4
5
6
# File 'lib/pact_broker/contracts/notice.rb', line 4

def self.info(text)
  Notice.new("info", text)
end

.prompt(text) ⇒ Object



16
17
18
# File 'lib/pact_broker/contracts/notice.rb', line 16

def self.prompt(text)
  Notice.new("prompt", text)
end

.success(text) ⇒ Object



20
21
22
# File 'lib/pact_broker/contracts/notice.rb', line 20

def self.success(text)
  Notice.new("success", text)
end

.warning(text) ⇒ Object



12
13
14
# File 'lib/pact_broker/contracts/notice.rb', line 12

def self.warning(text)
  Notice.new("warning", text)
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/pact_broker/contracts/notice.rb', line 28

def error?
  type == "error"
end