Class: Webspicy::Specification
- Inherits:
-
Object
- Object
- Webspicy::Specification
- Includes:
- Webspicy::Support::DataObject
- Defined in:
- lib/webspicy/specification.rb,
lib/webspicy/web/openapi/ext.rb,
lib/webspicy/specification/err.rb,
lib/webspicy/specification/pre.rb,
lib/webspicy/specification/post.rb,
lib/webspicy/specification/service.rb,
lib/webspicy/specification/condition.rb,
lib/webspicy/specification/test_case.rb,
lib/webspicy/specification/oldies/bridge.rb,
lib/webspicy/specification/oldies/errcondition.rb,
lib/webspicy/specification/oldies/precondition.rb,
lib/webspicy/specification/oldies/postcondition.rb,
lib/webspicy/specification/post/missing_condition_impl.rb,
lib/webspicy/specification/post/unexpected_condition_impl.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Condition, Err, Errcondition, Oldies, Post, Postcondition, Pre, Precondition Classes: Service, TestCase
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
-
#initialize(raw, location = nil) ⇒ Specification
constructor
A new instance of Specification.
- #locate(relative_path) ⇒ Object
- #located_at!(location) ⇒ Object
- #name ⇒ Object
- #relative_location ⇒ Object
- #services ⇒ Object
Methods included from Webspicy::Support::DataObject
Constructor Details
#initialize(raw, location = nil) ⇒ Specification
Returns a new instance of Specification.
5 6 7 8 9 |
# File 'lib/webspicy/specification.rb', line 5 def initialize(raw, location = nil) super(raw) @location = location bind_services end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Webspicy::Support::DataObject
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/webspicy/specification.rb', line 10 def config @config end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
11 12 13 |
# File 'lib/webspicy/specification.rb', line 11 def location @location end |
Instance Method Details
#locate(relative_path) ⇒ Object
21 22 23 24 25 |
# File 'lib/webspicy/specification.rb', line 21 def locate(relative_path) file = @location.parent/relative_path raise "File not found: #{file}" unless file.exists? file end |
#located_at!(location) ⇒ Object
13 14 15 |
# File 'lib/webspicy/specification.rb', line 13 def located_at!(location) @location = Path(location) end |
#name ⇒ Object
27 28 29 |
# File 'lib/webspicy/specification.rb', line 27 def name @raw[:name] || relative_location || "Unnamed" end |
#relative_location ⇒ Object
17 18 19 |
# File 'lib/webspicy/specification.rb', line 17 def relative_location @location && @location.relative_to(config.folder) end |
#services ⇒ Object
31 32 33 |
# File 'lib/webspicy/specification.rb', line 31 def services @raw[:services] || [] end |