るりまサーチ

最速Rubyリファレンスマニュアル検索!
15件ヒット [1-15件を表示] (0.169秒)
トップページ > クエリ:r[x] > クエリ:body[x] > クエリ:param[x] > クエリ:fetch[x]

別のキーワード

  1. net/http body
  2. httpresponse body
  3. net/http read_body
  4. httprequest body
  5. httpresponse read_body

ライブラリ

クラス

検索結果

Net::IMAP#fetch(set, attr) -> [Net::IMAP::FetchData] (18377.0)

FETCH コマンドを送り、メールボックス内のメッセージに 関するデータを取得します。

...
FETCH
コマンドを送り、メールボックス内のメッセージに
関するデータを取得します。

Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを対象とします。

set で対象とするメッセージを指定します。
これには...
...sequence number、sequence number の配列、もしくは
R
ange オブジェクトを渡します。
attr には取得するアトリビュートを文字列の配列で渡してください。
指定可能なアトリビュートについては Net::IMAP::FetchData#attr
を見てください。...
...imap.fetch(6..8, "UID")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, #<Net::IMAP::FetchData seqno=8, attr={"UID"=>100}>]
p imap.fetch(6, "BODY[HEADER.FIELDS (SUBJECT)]")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"BODY[HEADER.FIELD...

Data.define(*args) -> Class (148.0)

Data クラスに新しいサブクラスを作って、それを返します。

...ist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}

メンバの値を書き換えることはできません。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fred.age = 6 # => NoMethodError
//}...
...ruby]{
class HTTPFetcher
R
esponse = Data.define(:body)
NotFound = Data.define

def get(url)
# ダミーの実装
if url == "http://example.com/"
R
esponse.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetch
er = HTTPFetcher...
....new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body

in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトの...

Data.define(*args) {|subclass| block } -> Class (148.0)

Data クラスに新しいサブクラスを作って、それを返します。

...ist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}

メンバの値を書き換えることはできません。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fred.age = 6 # => NoMethodError
//}...
...ruby]{
class HTTPFetcher
R
esponse = Data.define(:body)
NotFound = Data.define

def get(url)
# ダミーの実装
if url == "http://example.com/"
R
esponse.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetch
er = HTTPFetcher...
....new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body

in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトの...