Class: CouchIO
- Inherits:
-
Object
- Object
- CouchIO
- Defined in:
- lib/couchio/couch_io.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#append ⇒ Object
Returns the value of attribute append.
-
#path ⇒ Object
Returns the value of attribute path.
-
#readable ⇒ Object
Returns the value of attribute readable.
-
#writeable ⇒ Object
Returns the value of attribute writeable.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(name, mode = 'r', &block) ⇒ CouchIO
constructor
A new instance of CouchIO.
- #read ⇒ Object
Constructor Details
#initialize(name, mode = 'r', &block) ⇒ CouchIO
Returns a new instance of CouchIO.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/couchio/couch_io.rb', line 7 def initialize(name, mode = 'r', &block) @path = name @readable = mode.include?('r') @writeable = mode.include?('w') @append = mode.include?('a') if block_given? yield(self) close end end |
Instance Attribute Details
#append ⇒ Object
Returns the value of attribute append.
5 6 7 |
# File 'lib/couchio/couch_io.rb', line 5 def append @append end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/couchio/couch_io.rb', line 5 def path @path end |
#readable ⇒ Object
Returns the value of attribute readable.
5 6 7 |
# File 'lib/couchio/couch_io.rb', line 5 def readable @readable end |
#writeable ⇒ Object
Returns the value of attribute writeable.
5 6 7 |
# File 'lib/couchio/couch_io.rb', line 5 def writeable @writeable end |
Instance Method Details
#close ⇒ Object
19 |
# File 'lib/couchio/couch_io.rb', line 19 def close; end |
#read ⇒ Object
21 22 23 |
# File 'lib/couchio/couch_io.rb', line 21 def read read_json end |