Class: Pione::PNML::ConstituentRule

Inherits:
Perspective show all
Defined in:
lib/pione/pnml/pione-model.rb

Overview

ConstituentRule is a class represents PIONE's constituent rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Perspective

action_rule?, compact, eliminate_comment, empty?, file?, flow_rule?, modifier, named?, net_input?, net_output?, normalize_data_name, param?, remove_comment, rule?, ticket?

Constructor Details

#initialize(type, name) ⇒ ConstituentRule

Returns a new instance of ConstituentRule.

Parameters:

  • type (Symbol)

    rule type of either :input or :output

  • name (String)

    rule name



191
192
193
194
195
# File 'lib/pione/pnml/pione-model.rb', line 191

def initialize(type, name)
  @type = type
  @name = name
  @params = []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



184
185
186
# File 'lib/pione/pnml/pione-model.rb', line 184

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



185
186
187
# File 'lib/pione/pnml/pione-model.rb', line 185

def params
  @params
end

#typeObject (readonly)

Returns the value of attribute type.



183
184
185
# File 'lib/pione/pnml/pione-model.rb', line 183

def type
  @type
end

Instance Method Details

#as_declaration(option = {}) ⇒ String

Return a declaration of constituent rule.

Returns:

  • (String)

    a declaration string for PIONE's constituent rule



201
202
203
# File 'lib/pione/pnml/pione-model.rb', line 201

def as_declaration(option={})
  indent("rule %s" % textize_rule_expr, option)
end