Class: CommentedFile

Inherits:
FileInfo show all
Defined in:
lib/piggy-core/file_info.rb

Instance Attribute Summary collapse

Attributes inherited from FileInfo

#ctime, #mtime, #size

Attributes inherited from FileName

#name, #path

Instance Method Summary collapse

Methods inherited from FileInfo

#ctime_string, #directory!, #directory?, #mtime_string

Methods inherited from FileName

#extension, #name_with_path, #name_without_extension, #path_sections, #set_path

Constructor Details

#initialize(the_name, the_path = '', the_comment = '') ⇒ CommentedFile

Returns a new instance of CommentedFile.



131
132
133
134
135
136
137
138
# File 'lib/piggy-core/file_info.rb', line 131

def initialize(the_name, the_path = '', the_comment = '')
  super(the_name, the_path)
  @comment = the_comment
  @date_time = nil
  @rotation = 0
  @width = 0
  @height = 0
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



129
130
131
# File 'lib/piggy-core/file_info.rb', line 129

def comment
  @comment
end

#date_timeObject

Returns the value of attribute date_time.



129
130
131
# File 'lib/piggy-core/file_info.rb', line 129

def date_time
  @date_time
end

#heightObject

Returns the value of attribute height.



129
130
131
# File 'lib/piggy-core/file_info.rb', line 129

def height
  @height
end

#rotationObject

Returns the value of attribute rotation.



129
130
131
# File 'lib/piggy-core/file_info.rb', line 129

def rotation
  @rotation
end

#widthObject

Returns the value of attribute width.



129
130
131
# File 'lib/piggy-core/file_info.rb', line 129

def width
  @width
end

Instance Method Details

#rotate?Boolean

Returns:

  • (Boolean)


144
145
146
# File 'lib/piggy-core/file_info.rb', line 144

def rotate?
  @rotation && @rotation != 0
end

#timeObject



140
141
142
# File 'lib/piggy-core/file_info.rb', line 140

def time
  @date_time.nil? ? @ctime : @date_time
end