Class: Eco::Language::Models::Modifier
- Inherits:
-
Array
- Object
- Array
- Eco::Language::Models::Modifier
show all
- Defined in:
- lib/eco/language/models/modifier.rb
Constant Summary
collapse
- DEFAULT_MODE =
[:default, :none]
Instance Method Summary
collapse
Constructor Details
#initialize(value = []) ⇒ Modifier
Returns a new instance of Modifier.
8
9
10
|
# File 'lib/eco/language/models/modifier.rb', line 8
def initialize(value = [])
super(into_a(value))
end
|
Instance Method Details
22
23
24
|
# File 'lib/eco/language/models/modifier.rb', line 22
def <(value)
self.clear << value
end
|
#<<(value) ⇒ Object
26
27
28
|
# File 'lib/eco/language/models/modifier.rb', line 26
def <<(value)
self.concat(into_a(value))
end
|
#default(value) ⇒ Object
34
35
36
37
|
# File 'lib/eco/language/models/modifier.rb', line 34
def default(value)
reset
end
|
#default? ⇒ Boolean
43
44
45
|
# File 'lib/eco/language/models/modifier.rb', line 43
def default?
(mode - DEFAULT_MODE).length == 0
end
|
#flush_mode ⇒ Object
30
31
32
|
# File 'lib/eco/language/models/modifier.rb', line 30
def flush_mode
self < self.mode
end
|
MODE MODIFIERS
resolve mode
18
19
20
|
# File 'lib/eco/language/models/modifier.rb', line 18
def mode
resolve_mode
end
|
12
13
14
|
# File 'lib/eco/language/models/modifier.rb', line 12
def new
self.class.new(self.resolve_mode.to_a)
end
|
39
40
41
|
# File 'lib/eco/language/models/modifier.rb', line 39
def reset
self < DEFAULT_MODE.first
end
|