Class: Strut::Document
- Inherits:
-
Object
- Object
- Strut::Document
- Defined in:
- lib/strut/document.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
-
#initialize(commands) ⇒ Document
constructor
A new instance of Document.
- #metadata_for_command_id(id) ⇒ Object
Constructor Details
#initialize(commands) ⇒ Document
Returns a new instance of Document.
5 6 7 |
# File 'lib/strut/document.rb', line 5 def initialize(commands) @commands = commands end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
3 4 5 |
# File 'lib/strut/document.rb', line 3 def commands @commands end |
Instance Method Details
#metadata_for_command_id(id) ⇒ Object
9 10 11 12 |
# File 'lib/strut/document.rb', line 9 def (id) command = @commands.find { |c| c.id == id } command ? command. : nil end |