This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Garden | |
| def initialize(gardener) | |
| @gardener = gardener | |
| end | |
| end | |
| class Gardener | |
| def initialize(workday, boots) | |
| @workday = workday | |
| @boots = boots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Garden | |
| def initialize(gardener) | |
| gardener.set_workday(Workday.new) | |
| gardener.set_boots(BootsWithMassiveStaticInitBlock.new) | |
| @gardener = gardener | |
| end | |
| end | |
| class Gardener | |
| def set_workday(workday) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class House | |
| attr_reader :bedroom | |
| def initialize(bedroom) | |
| @bedroom = bedroom | |
| end | |
| def enough_space?(people_count) | |
| bedroom.beds_count >= people_count | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class House | |
| attr_reader :bedroom | |
| def initialize | |
| @bedroom = Bedroom.new | |
| end | |
| def enough_space?(people_count) | |
| bedroom.beds_count >= people_count | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Submission | |
| MINIMAL_AGE = 18 | |
| attr_accessor :age | |
| def can_attend? | |
| age > MINIMAL_AGE | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| import React from 'react-native'; | |
| let { | |
| StyleSheet, | |
| } = React; | |
| let colors = { | |
| blue: '#1EC1F7', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| import Axios from 'axios'; | |
| const BASE_URL = 'http://localhost:3000/api'; | |
| class ApiConnector { | |
| get(path, data = {}) { | |
| return Axios.get(`${BASE_URL}${path}`, { params: data }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ActionTypes from '../constants/ActionTypes'; | |
| import Connection from '../lib/Connection'; | |
| const _requestSubmissionsList = (submissionType) => { | |
| return { | |
| type: ActionTypes.REQUEST_SUBMISSIONS_LIST, | |
| submission_type: submissionType | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| REQUEST_SUBMISSIONS_LIST: 'REQUEST_SUBMISSIONS_LIST', | |
| RECEIVE_SUBMISSIONS_LIST: 'RECEIVE_SUBMISSIONS_LIST', | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ActionTypes from '../constants/ActionTypes'; | |
| let SubmissionsReducer = (state = {}, action) => { | |
| let newState; | |
| switch (action.type) { | |
| case ActionTypes.RECEIVE_SUBMISSIONS_LIST: | |
| newState = {}; | |
| action.submissions.forEach((s) => { | |
| newState[s.id] = s; |
NewerOlder