Class: PactBroker::Client::PactFile
- Inherits:
-
Object
- Object
- PactBroker::Client::PactFile
- Defined in:
- lib/pact_broker/client/pact_file.rb
Instance Method Summary collapse
- #consumer_name ⇒ Object
-
#initialize(path) ⇒ PactFile
constructor
A new instance of PactFile.
- #pact_hash ⇒ Object
- #pact_name ⇒ Object
- #path ⇒ Object
- #provider_name ⇒ Object
- #read ⇒ Object
Constructor Details
#initialize(path) ⇒ PactFile
Returns a new instance of PactFile.
7 8 9 |
# File 'lib/pact_broker/client/pact_file.rb', line 7 def initialize path @path = path end |
Instance Method Details
#consumer_name ⇒ Object
19 20 21 |
# File 'lib/pact_broker/client/pact_file.rb', line 19 def consumer_name pact_hash.consumer_name end |
#pact_hash ⇒ Object
27 28 29 |
# File 'lib/pact_broker/client/pact_file.rb', line 27 def pact_hash @pact_hash ||= PactHash[JSON.parse(read, symbolize_names: true)] end |
#pact_name ⇒ Object
15 16 17 |
# File 'lib/pact_broker/client/pact_file.rb', line 15 def pact_name pact_hash.pact_name end |
#path ⇒ Object
11 12 13 |
# File 'lib/pact_broker/client/pact_file.rb', line 11 def path @path end |
#provider_name ⇒ Object
23 24 25 |
# File 'lib/pact_broker/client/pact_file.rb', line 23 def provider_name pact_hash.provider_name end |
#read ⇒ Object
31 32 33 |
# File 'lib/pact_broker/client/pact_file.rb', line 31 def read @read ||= File.read(@path) end |