Class: Editus::Script::Internal
- Inherits:
-
Object
- Object
- Editus::Script::Internal
- Defined in:
- lib/editus/script.rb
Class Attribute Summary collapse
-
.scripts ⇒ Object
readonly
Returns the value of attribute scripts.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#queries ⇒ Object
Returns the value of attribute queries.
- #title ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
- #add_query(desc, name) ⇒ Object
- #down ⇒ Object
-
#initialize(name = nil) ⇒ Internal
constructor
A new instance of Internal.
- #up ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Internal
Returns a new instance of Internal.
27 28 29 30 |
# File 'lib/editus/script.rb', line 27 def initialize name = nil @name = name @queries = [] end |
Class Attribute Details
.scripts ⇒ Object (readonly)
Returns the value of attribute scripts.
17 18 19 |
# File 'lib/editus/script.rb', line 17 def scripts @scripts end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
24 25 26 |
# File 'lib/editus/script.rb', line 24 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/editus/script.rb', line 24 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
24 25 26 |
# File 'lib/editus/script.rb', line 24 def path @path end |
#proxy ⇒ Object
Returns the value of attribute proxy.
24 25 26 |
# File 'lib/editus/script.rb', line 24 def proxy @proxy end |
#queries ⇒ Object
Returns the value of attribute queries.
24 25 26 |
# File 'lib/editus/script.rb', line 24 def queries @queries end |
#title ⇒ Object
44 45 46 |
# File 'lib/editus/script.rb', line 44 def title @title || @name.to_s.humanize end |
Class Method Details
.find_or_create(name) ⇒ Object
20 21 22 |
# File 'lib/editus/script.rb', line 20 def self.find_or_create name @scripts[name.to_sym] || @scripts[name.to_sym] = new(name.to_sym) end |
Instance Method Details
#add_query(desc, name) ⇒ Object
32 33 34 |
# File 'lib/editus/script.rb', line 32 def add_query desc, name @queries.push({description: desc, query_name: name}) end |
#down ⇒ Object
40 41 42 |
# File 'lib/editus/script.rb', line 40 def down content[/task\s.*down.*do.*\n[\s\S]*?\n\s*end/] end |
#up ⇒ Object
36 37 38 |
# File 'lib/editus/script.rb', line 36 def up content[/task\s.*up.*do.*\n[\s\S]*?\n\s*end/] end |