Class: NOMS::Command::Document

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ Document

Returns a new instance of Document.



17
18
19
20
21
# File 'lib/noms/command/document.rb', line 17

def initialize(doc)
    raise NOMS::Command::Error.new "Document type '#{docobj['$doctype']}' not understood" unless
        doc['$doctype'] == 'noms-v2'
    @doc = doc
end

Instance Attribute Details

#argvObject

Returns the value of attribute argv.



15
16
17
# File 'lib/noms/command/document.rb', line 15

def argv
  @argv
end

#exitcodeObject

Returns the value of attribute exitcode.



15
16
17
# File 'lib/noms/command/document.rb', line 15

def exitcode
  @exitcode
end

Instance Method Details

#bodyObject

Make these synonymous with the keys



24
25
26
# File 'lib/noms/command/document.rb', line 24

def body
    @doc['$body']
end

#body=(rval) ⇒ Object



28
29
30
# File 'lib/noms/command/document.rb', line 28

def body=(rval)
    @doc['$body'] = rval
end

#scriptObject



32
33
34
# File 'lib/noms/command/document.rb', line 32

def script
    @doc['$script']
end

#script=(rval) ⇒ Object



36
37
38
# File 'lib/noms/command/document.rb', line 36

def script=(rval)
    @doc['$script'] = rval
end