Class: Srgs::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/srgs/elements/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, scope = 'private', dynamic = nil) ⇒ Rule

Returns a new instance of Rule.



6
7
8
9
10
11
# File 'lib/srgs/elements/rule.rb', line 6

def initialize(id, scope = 'private', dynamic = nil)
  @id = id
  @elements = Array.new
  @scope = scope
  @dynamic = dynamic
end

Instance Attribute Details

#dynamicObject

Returns the value of attribute dynamic.



4
5
6
# File 'lib/srgs/elements/rule.rb', line 4

def dynamic
  @dynamic
end

#elementsObject

Returns the value of attribute elements.



4
5
6
# File 'lib/srgs/elements/rule.rb', line 4

def elements
  @elements
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/srgs/elements/rule.rb', line 4

def id
  @id
end

#scopeObject

Returns the value of attribute scope.



4
5
6
# File 'lib/srgs/elements/rule.rb', line 4

def scope
  @scope
end

Instance Method Details

#<<(element) ⇒ Object



13
14
15
16
# File 'lib/srgs/elements/rule.rb', line 13

def <<(element)
  @elements << element
  self
end