Class: Hermeneutics::IdList

Inherits:
Object
  • Object
show all
Defined in:
lib/hermeneutics/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*ids) ⇒ IdList

Returns a new instance of IdList.



123
124
125
126
# File 'lib/hermeneutics/types.rb', line 123

def initialize *ids
  ids.flatten!
  self.value = ids
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



122
123
124
# File 'lib/hermeneutics/types.rb', line 122

def value
  @value
end

Class Method Details

.parse(str) ⇒ Object



112
113
114
115
116
117
118
119
120
# File 'lib/hermeneutics/types.rb', line 112

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

#encodeObject



139
140
141
# File 'lib/hermeneutics/types.rb', line 139

def encode
  map { |i| i.encode }.join " "
end

#to_sObject Also known as: quote



135
136
137
# File 'lib/hermeneutics/types.rb', line 135

def to_s
  map { |i| i.quote }.join " "
end