class MatterCompiler::Action
represetns 'action sction'
@attr method [String] HTTP request method or nil @attr parameters [Parameters] action-specific URI parameters or nil @attr examples [Array<TransactionExample>] action transaction examples
Attributes
examples[RW]
method[RW]
parameters[RW]
Public Instance Methods
load_ast!(ast)
click to toggle source
Calls superclass method
MatterCompiler::NamedBlueprintNode#load_ast!
# File lib/matter_compiler/blueprint.rb, line 430 def load_ast!(ast) super(ast) @method = ast[:method] @parameters = Parameters.new(ast[:parameters]) unless ast[:parameters].blank? unless ast[:examples].blank? @examples = Array.new ast[:examples].each { |example_ast| @examples << TransactionExample.new(example_ast) } end end
serialize()
click to toggle source
# File lib/matter_compiler/blueprint.rb, line 442 def serialize buffer = "" if @name.blank? buffer << "### #{@method}\n" else buffer << "### #{@name} [#{@method}]\n" end buffer << "#{@description}" unless @description.blank? ensure_description_newlines(buffer) buffer << @parameters.serialize unless @parameters.nil? @examples.each { |example| buffer << example.serialize } unless @examples.nil? buffer end