Class: Hermeneutics::IdList
- Inherits:
-
Array
- Object
- Array
- Hermeneutics::IdList
show all
- Defined in:
- lib/hermeneutics/types.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Array
#eat_lines, #rewind, #to_hsv, #to_rgb
Constructor Details
#initialize ⇒ IdList
Returns a new instance of IdList.
104
105
106
|
# File 'lib/hermeneutics/types.rb', line 104
def initialize
super
end
|
Class Method Details
.parse(str) ⇒ Object
94
95
96
97
98
99
100
101
102
|
# File 'lib/hermeneutics/types.rb', line 94
def parse str
i = new
loop do
id = Id.parse str do |rest| str = rest end
id or break
i.push id
end
i
end
|
Instance Method Details
#add(id) ⇒ Object
107
108
109
110
|
# File 'lib/hermeneutics/types.rb', line 107
def add id
id = Id.new id.to_s unless Id === id
puts id
end
|
#encode ⇒ Object
115
116
117
|
# File 'lib/hermeneutics/types.rb', line 115
def encode
map { |i| i.encode }.join " "
end
|
#quote ⇒ Object
Also known as:
to_s
111
112
113
|
# File 'lib/hermeneutics/types.rb', line 111
def quote
map { |i| i.quote }.join " "
end
|