Class: Ajimi::Server::Entry
- Inherits:
-
Object
- Object
- Ajimi::Server::Entry
- Defined in:
- lib/ajimi/server/entry.rb
Instance Attribute Summary collapse
-
#bytes ⇒ Object
Returns the value of attribute bytes.
-
#group ⇒ Object
Returns the value of attribute group.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#path ⇒ Object
Returns the value of attribute path.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #dir? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize(params) ⇒ Entry
constructor
A new instance of Entry.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ Entry
Returns a new instance of Entry.
6 7 8 9 10 11 12 |
# File 'lib/ajimi/server/entry.rb', line 6 def initialize(params) @path = params[:path] @mode = params[:mode] @user = params[:user] @group = params[:group] @bytes = params[:bytes] end |
Instance Attribute Details
#bytes ⇒ Object
Returns the value of attribute bytes.
4 5 6 |
# File 'lib/ajimi/server/entry.rb', line 4 def bytes @bytes end |
#group ⇒ Object
Returns the value of attribute group.
4 5 6 |
# File 'lib/ajimi/server/entry.rb', line 4 def group @group end |
#mode ⇒ Object
Returns the value of attribute mode.
4 5 6 |
# File 'lib/ajimi/server/entry.rb', line 4 def mode @mode end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/ajimi/server/entry.rb', line 4 def path @path end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/ajimi/server/entry.rb', line 4 def user @user end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ajimi/server/entry.rb', line 14 def ==(other) self.path == other.path && self.mode == other.mode && self.user == other.user && self.group == other.group && self.bytes == other.bytes end |
#dir? ⇒ Boolean
26 27 28 |
# File 'lib/ajimi/server/entry.rb', line 26 def dir? @mode[0] == "d" end |
#file? ⇒ Boolean
30 31 32 |
# File 'lib/ajimi/server/entry.rb', line 30 def file? @mode[0] == "-" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/ajimi/server/entry.rb', line 22 def to_s "#{@path}, #{@mode}, #{@user}, #{@group}, #{@bytes}" end |