aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-13 00:47:01 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-13 00:47:01 +0000
commit679bc107ddb75a6384dd8e7182f649cbd4437627 (patch)
treeeb398c43ab5cac56eea00d0e60b58e1a11cc0250 /lib
parent4ba99498e901dbc68303487547653a4dcbfbe3b7 (diff)
downloadruby-679bc107ddb75a6384dd8e7182f649cbd4437627.tar.gz
* lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,
media_type, charset): new methods to return standard facts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index f5d45a80a1..494cd478b1 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -781,6 +781,14 @@ module Net
@pathname = pathname
end
+ standard_facts = %w(size modify create type unique perm
+ lang media-type charset)
+ standard_facts.each do |factname|
+ define_method factname.gsub(/-/, "_") do
+ facts[factname]
+ end
+ end
+
#
# Returns +true+ if the entry is a file (i.e., the value of the type
# fact is file).