Sha256: a6c3bd2216158414094d5836a772e34f94a69434d438d52948aea814373fe8d7

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

#--
# gravaty
# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019  Marco Bresciani
#
# This file is part of gravaty.
#
# gravaty is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# gravaty is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with gravaty. If not, see <http://www.gnu.org/licenses/>.
#++

module Gravaty
  module Parsers

    # This class is an implementation of the Parsable duck type that
    # provides the secure or unsecure URI. The only needed parameter is
    # a boolean, with +true+ for secure.
    #
    # Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
    # Copyright:: Copyright © 2013, 2014, 2015, 2016, 2017, 2018,
    # 2019  Marco Bresciani
    # License:: GNU General Public License version 3
    class Secure
      # The parsable duck type interface to every parser usage.
      def parse(value = false)
        value ? 'https://secure' : 'http://www'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gravaty-9.0.1 lib/gravaty/parsers/secure.rb
gravaty-9.0.0 lib/gravaty/parsers/secure.rb