Class: Redmine::Scm::Adapters::Entry
- Inherits:
-
Object
- Object
- Redmine::Scm::Adapters::Entry
- Defined in:
- lib/redmine/scm/adapters/abstract_adapter.rb
Instance Attribute Summary collapse
-
#changeset ⇒ Object
Returns the value of attribute changeset.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#lastrev ⇒ Object
Returns the value of attribute lastrev.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #author ⇒ Object
-
#initialize(attributes = {}) ⇒ Entry
constructor
A new instance of Entry.
- #is_dir? ⇒ Boolean
- #is_file? ⇒ Boolean
- #is_text? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Entry
Returns a new instance of Entry.
335 336 337 338 339 340 341 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 335 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
#changeset ⇒ Object
Returns the value of attribute changeset.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def changeset @changeset end |
#kind ⇒ Object
Returns the value of attribute kind.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def kind @kind end |
#lastrev ⇒ Object
Returns the value of attribute lastrev.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def lastrev @lastrev end |
#name ⇒ Object
Returns the value of attribute name.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
333 334 335 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 333 def size @size end |
Instance Method Details
#author ⇒ Object
355 356 357 358 359 360 361 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 355 def if changeset changeset..to_s elsif lastrev Redmine::CodesetUtil.replace_invalid_utf8(lastrev..to_s.split('<').first) end end |
#is_dir? ⇒ Boolean
347 348 349 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 347 def is_dir? self.kind == 'dir' end |
#is_file? ⇒ Boolean
343 344 345 |
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 343 def is_file? self.kind == 'file' end |