Class: SmallCage::Commands::Import::ImportEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/smallcage/commands/import.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fromObject

Returns the value of attribute from.



171
172
173
# File 'lib/smallcage/commands/import.rb', line 171

def from
  @from
end

#pathObject

Returns the value of attribute path.



171
172
173
# File 'lib/smallcage/commands/import.rb', line 171

def path
  @path
end

#toObject

Returns the value of attribute to.



171
172
173
# File 'lib/smallcage/commands/import.rb', line 171

def to
  @to
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


185
186
187
# File 'lib/smallcage/commands/import.rb', line 185

def exist?
  to.exist?
end

#external?Boolean

Returns:

  • (Boolean)


181
182
183
# File 'lib/smallcage/commands/import.rb', line 181

def external?
  from.to_s =~ %r{^https?://}
end

#importObject



173
174
175
176
177
178
179
# File 'lib/smallcage/commands/import.rb', line 173

def import
  if external?
    copy_external
  else
    copy_local
  end
end

#overwrite?Boolean

Returns:

  • (Boolean)


189
190
191
# File 'lib/smallcage/commands/import.rb', line 189

def overwrite?
  to.file?
end