Class: Swoop::FileInfo
- Inherits:
-
Object
- Object
- Swoop::FileInfo
- Defined in:
- lib/swoop/file_info.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#extensions ⇒ Object
readonly
Returns the value of attribute extensions.
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#line_count ⇒ Object
readonly
Returns the value of attribute line_count.
-
#structs ⇒ Object
readonly
Returns the value of attribute structs.
Instance Method Summary collapse
- #==(comparee) ⇒ Object
- #entities ⇒ Object
- #eql?(comparee) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(filepath, language, line_count, classes, structs, extensions) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #objc? ⇒ Boolean
- #swift? ⇒ Boolean
Constructor Details
#initialize(filepath, language, line_count, classes, structs, extensions) ⇒ FileInfo
Returns a new instance of FileInfo.
13 14 15 16 17 18 19 20 |
# File 'lib/swoop/file_info.rb', line 13 def initialize(filepath, language, line_count, classes, structs, extensions) @filepath = filepath @language = language @line_count = line_count @classes = classes @structs = structs @extensions = extensions end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def classes @classes end |
#extensions ⇒ Object (readonly)
Returns the value of attribute extensions.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def extensions @extensions end |
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def filepath @filepath end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def language @language end |
#line_count ⇒ Object (readonly)
Returns the value of attribute line_count.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def line_count @line_count end |
#structs ⇒ Object (readonly)
Returns the value of attribute structs.
11 12 13 |
# File 'lib/swoop/file_info.rb', line 11 def structs @structs end |
Instance Method Details
#==(comparee) ⇒ Object
44 45 46 |
# File 'lib/swoop/file_info.rb', line 44 def ==(comparee) self.filepath == comparee.filepath end |
#entities ⇒ Object
30 31 32 33 34 |
# File 'lib/swoop/file_info.rb', line 30 def entities @entities ||= begin [ *classes, *structs, *extensions ] end end |
#eql?(comparee) ⇒ Boolean
40 41 42 |
# File 'lib/swoop/file_info.rb', line 40 def eql?(comparee) self == comparee end |
#hash ⇒ Object
36 37 38 |
# File 'lib/swoop/file_info.rb', line 36 def hash filepath.hash end |