Class: Redmine::Scm::Adapters::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/scm/adapters/abstract_adapter.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Entry) initialize(attributes = {})

Returns a new instance of Entry



274
275
276
277
278
279
280
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 274

def initialize(attributes={})
  self.name = attributes[:name] if attributes[:name]
  self.path = attributes[:path] if attributes[:path]
  self.kind = attributes[:kind] if attributes[:kind]
  self.size = attributes[:size].to_i if attributes[:size]
  self.lastrev = attributes[:lastrev]
end

Instance Attribute Details

- (Object) kind

Returns the value of attribute kind



273
274
275
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 273

def kind
  @kind
end

- (Object) lastrev

Returns the value of attribute lastrev



273
274
275
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 273

def lastrev
  @lastrev
end

- (Object) name

Returns the value of attribute name



273
274
275
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 273

def name
  @name
end

- (Object) path

Returns the value of attribute path



273
274
275
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 273

def path
  @path
end

- (Object) size

Returns the value of attribute size



273
274
275
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 273

def size
  @size
end

Instance Method Details

- (Boolean) is_dir?

Returns:

  • (Boolean)


286
287
288
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 286

def is_dir?
  'dir' == self.kind
end

- (Boolean) is_file?

Returns:

  • (Boolean)


282
283
284
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 282

def is_file?
  'file' == self.kind
end

- (Boolean) is_text?

Returns:

  • (Boolean)


290
291
292
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 290

def is_text?
  Redmine::MimeType.is_type?('text', name)
end