Class: DmAdapterSimpledb::ChunkedString
- Inherits:
-
String
- Object
- String
- DmAdapterSimpledb::ChunkedString
- Defined in:
- lib/dm-adapter-simpledb/chunked_string.rb
Constant Summary collapse
- MAX_CHUNK_SIZE =
1019
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(string_or_array) ⇒ ChunkedString
constructor
A new instance of ChunkedString.
- #to_ary ⇒ Object (also: #to_a)
Constructor Details
#initialize(string_or_array) ⇒ ChunkedString
Returns a new instance of ChunkedString.
9 10 11 12 13 14 |
# File 'lib/dm-adapter-simpledb/chunked_string.rb', line 9 def initialize(string_or_array) case string_or_array when Array then super(chunks_to_string(string_or_array)) else super(string_or_array) end end |
Class Method Details
.valid?(values) ⇒ Boolean
5 6 7 |
# File 'lib/dm-adapter-simpledb/chunked_string.rb', line 5 def self.valid?(values) values.all?{|v| v =~ /^\d{4}:/} end |
Instance Method Details
#to_ary ⇒ Object Also known as: to_a
16 17 18 |
# File 'lib/dm-adapter-simpledb/chunked_string.rb', line 16 def to_ary string_to_chunks(self) end |