Class: Hermeneutics::IdList
Class Method Summary collapse
Instance Method Summary collapse
- #add(id) ⇒ Object
- #encode ⇒ Object
-
#initialize ⇒ IdList
constructor
A new instance of IdList.
- #quote ⇒ Object (also: #to_s)
Methods inherited from Array
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 |