Class: FlatKit::Input::File
- Inherits:
-
FlatKit::Input
- Object
- FlatKit::Input
- FlatKit::Input::File
- Defined in:
- lib/flat_kit/input/file.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(obj) ⇒ File
constructor
A new instance of File.
- #io ⇒ Object
- #name ⇒ Object
Methods inherited from FlatKit::Input
Methods included from DescendantTracker
#children, #find_child, #inherited
Constructor Details
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
7 8 9 |
# File 'lib/flat_kit/input/file.rb', line 7 def count @count end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/flat_kit/input/file.rb', line 6 def path @path end |
Class Method Details
.handles?(obj) ⇒ Boolean
9 10 11 12 13 14 15 16 17 |
# File 'lib/flat_kit/input/file.rb', line 9 def self.handles?(obj) return true if obj.instance_of?(Pathname) return false unless obj.instance_of?(String) # incase these get loaded in different orders return false if ::FlatKit::Input::IO.is_stdin?(obj) return true end |
Instance Method Details
#close ⇒ Object
30 31 32 |
# File 'lib/flat_kit/input/file.rb', line 30 def close @io.close end |
#io ⇒ Object
34 35 36 |
# File 'lib/flat_kit/input/file.rb', line 34 def io @io end |
#name ⇒ Object
26 27 28 |
# File 'lib/flat_kit/input/file.rb', line 26 def name path.to_s end |