Class: SignalWire::SWML::Schema
- Inherits:
-
Object
- Object
- SignalWire::SWML::Schema
- Defined in:
- lib/signalwire/swml/schema.rb
Instance Attribute Summary collapse
-
#verbs ⇒ Object
readonly
Returns the value of attribute verbs.
Instance Method Summary collapse
-
#get_verb(name) ⇒ Object
Return the full definition hash for a verb, or nil.
-
#initialize ⇒ Schema
constructor
A new instance of Schema.
-
#valid_verb?(name) ⇒ Boolean
Is
namea recognised SWML verb?. -
#verb_count ⇒ Object
How many verbs are defined in the schema.
-
#verb_names ⇒ Object
Sorted list of all known verb names.
Constructor Details
#initialize ⇒ Schema
Returns a new instance of Schema.
10 11 12 13 |
# File 'lib/signalwire/swml/schema.rb', line 10 def initialize @verbs = {} load_schema end |
Instance Attribute Details
#verbs ⇒ Object (readonly)
Returns the value of attribute verbs.
8 9 10 |
# File 'lib/signalwire/swml/schema.rb', line 8 def verbs @verbs end |
Instance Method Details
#get_verb(name) ⇒ Object
Return the full definition hash for a verb, or nil.
31 32 33 |
# File 'lib/signalwire/swml/schema.rb', line 31 def get_verb(name) @verbs[name.to_s] end |
#valid_verb?(name) ⇒ Boolean
Is name a recognised SWML verb?
16 17 18 |
# File 'lib/signalwire/swml/schema.rb', line 16 def valid_verb?(name) @verbs.key?(name.to_s) end |
#verb_count ⇒ Object
How many verbs are defined in the schema.
26 27 28 |
# File 'lib/signalwire/swml/schema.rb', line 26 def verb_count @verbs.size end |
#verb_names ⇒ Object
Sorted list of all known verb names.
21 22 23 |
# File 'lib/signalwire/swml/schema.rb', line 21 def verb_names @verbs.keys.sort end |