Sha256: ed2381da002752425e9a47aafb860124d18a4e8be550fe66940bc348b3560944

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

module Bijo
  class Arguments
    def initialize(argv)
      @argv = argv
    end

    def query
      # スペース入りの query に対応する
      query = ''
      ARGV.each do |arg|
        query += " #{arg}"
      end
      query.slice!(0)
      query
    end

    def valid?
      has_query?
    end

    def request_service
      # 後々、リクエスト先サービスを切り替える際にちゃんと実装する
      'tumblr'
    end

    private

    def has_query?
      !@argv.empty?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bijo-0.0.1 lib/bijo/arguments.rb