Skip to content

Instantly share code, notes, and snippets.

@dankozlowski
Last active February 26, 2019 19:50
Show Gist options
  • Save dankozlowski/43a1e92d089366946446e651ff1f64de to your computer and use it in GitHub Desktop.
Save dankozlowski/43a1e92d089366946446e651ff1f64de to your computer and use it in GitHub Desktop.

Revisions

  1. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ def get_string_answer
    end

    def process_string_answer(answer)
    if answer = "y"
    if answer == "y"
    puts "What kind of software do you work on?"
    else
    puts ":/"
  2. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ def get_answer(answer)

    def get_string_answer
    puts "Want to chat? y/n"
    @answer = gets
    gets
    end

    def process_string_answer(answer)
  3. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ def get_answer(answer)

    def get_string_answer
    puts "Want to chat? y/n"
    gets
    @answer = gets
    end

    def process_string_answer(answer)
  4. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ def initialize(answer)

    def get_answer(answer)
    r = get_string_answer
    process_consent(r)
    process_string_answer(r)
    end

    private
    @@ -17,7 +17,7 @@ def get_string_answer
    gets
    end

    def process_answer(answer)
    def process_string_answer(answer)
    if answer = "y"
    puts "What kind of software do you work on?"
    else
  5. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ def process_answer(answer)
    if answer = "y"
    puts "What kind of software do you work on?"
    else
    answer ":/"
    puts ":/"
    end
    end
    end
  6. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ class WantToChatAnswerGetter
    attr_accessor :answer

    def initialize(answer)
    @consent = get_answer(answer)
    @answer = get_answer(answer)
    end

    def get_answer(answer)
  7. dankozlowski revised this gist Feb 26, 2019. 1 changed file with 12 additions and 13 deletions.
    25 changes: 12 additions & 13 deletions want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -1,28 +1,27 @@
    class WantToChatConsentGetter
    # Defining the accessor gives us class variables. - dank
    attr_accessor :dan_consent
    attr_accessor :firstName_consent
    class WantToChatAnswerGetter
    attr_accessor :answer

    def initialize
    # class variables @dan_consent, @firstName already initialized
    # as nil - dank

    r = get_firstName_consent
    def initialize(answer)
    @consent = get_answer(answer)
    end

    def get_answer(answer)
    r = get_string_answer
    process_consent(r)
    end

    private

    def get_firstName_consent
    def get_string_answer
    puts "Want to chat? y/n"
    gets
    end

    def process_consent(consent)
    if r = "y"
    def process_answer(answer)
    if answer = "y"
    puts "What kind of software do you work on?"
    else
    puts ":/"
    answer ":/"
    end
    end
    end
  8. dankozlowski created this gist Feb 26, 2019.
    28 changes: 28 additions & 0 deletions want_to_chat_getter.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    class WantToChatConsentGetter
    # Defining the accessor gives us class variables. - dank
    attr_accessor :dan_consent
    attr_accessor :firstName_consent

    def initialize
    # class variables @dan_consent, @firstName already initialized
    # as nil - dank

    r = get_firstName_consent
    process_consent(r)
    end

    private

    def get_firstName_consent
    puts "Want to chat? y/n"
    gets
    end

    def process_consent(consent)
    if r = "y"
    puts "What kind of software do you work on?"
    else
    puts ":/"
    end
    end
    end