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.



117
118
119
120
# File 'lib/hermeneutics/types.rb', line 117

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

Instance Attribute Details

#valueObject

Returns the value of attribute value.



116
117
118
# File 'lib/hermeneutics/types.rb', line 116

def value
  @value
end

Class Method Details

.parse(str) ⇒ Object



106
107
108
109
110
111
112
113
114
# File 'lib/hermeneutics/types.rb', line 106

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



133
134
135
# File 'lib/hermeneutics/types.rb', line 133

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

#to_sObject Also known as: quote



129
130
131
# File 'lib/hermeneutics/types.rb', line 129

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