Class: Eax::EaxFile

Inherits:
Object
  • Object
show all
Defined in:
lib/eax.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ EaxFile

Returns a new instance of EaxFile.



72
73
74
75
# File 'lib/eax.rb', line 72

def initialize(file)
  @path_name = Pathname.new(file)
  @type = file_type(@path_name)
end

Instance Attribute Details

#path_nameObject

Returns the value of attribute path_name.



70
71
72
# File 'lib/eax.rb', line 70

def path_name
  @path_name
end

#typeObject

Returns the value of attribute type.



70
71
72
# File 'lib/eax.rb', line 70

def type
  @type
end

Instance Method Details

#colorObject



77
78
79
# File 'lib/eax.rb', line 77

def color
  @color ||= Pastel.new
end

#output(options) ⇒ Object



81
82
83
84
85
86
87
88
89
# File 'lib/eax.rb', line 81

def output(options)
  if options.long?
    [print_rights, print_size(bytes: options.bytes?), print_user(group: options.group?),
    choose_date_to_print(options), print_name
    ]
  else
    [print_name]
  end.join(' ')
end