Class: Strut::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/strut/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandsObject (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