Class: AskAwesomely::Picture
- Inherits:
-
Object
- Object
- AskAwesomely::Picture
- Defined in:
- lib/ask_awesomely/picture.rb
Constant Summary collapse
- DEFAULT_TYPE =
:choice
- PICTURE_TYPES =
[ :choice ]
Instance Attribute Summary collapse
-
#file_or_url ⇒ Object
readonly
Returns the value of attribute file_or_url.
-
#public_url ⇒ Object
readonly
Returns the value of attribute public_url.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#typeform_id ⇒ Object
readonly
Returns the value of attribute typeform_id.
Instance Method Summary collapse
-
#initialize(file_or_url, type: DEFAULT_TYPE) ⇒ Picture
constructor
A new instance of Picture.
- #to_json ⇒ Object
Constructor Details
#initialize(file_or_url, type: DEFAULT_TYPE) ⇒ Picture
Returns a new instance of Picture.
12 13 14 15 |
# File 'lib/ask_awesomely/picture.rb', line 12 def initialize(file_or_url, type: DEFAULT_TYPE) @file_or_url = file_or_url @type = type end |
Instance Attribute Details
#file_or_url ⇒ Object (readonly)
Returns the value of attribute file_or_url.
4 5 6 |
# File 'lib/ask_awesomely/picture.rb', line 4 def file_or_url @file_or_url end |
#public_url ⇒ Object (readonly)
Returns the value of attribute public_url.
4 5 6 |
# File 'lib/ask_awesomely/picture.rb', line 4 def public_url @public_url end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/ask_awesomely/picture.rb', line 4 def type @type end |
#typeform_id ⇒ Object (readonly)
Returns the value of attribute typeform_id.
4 5 6 |
# File 'lib/ask_awesomely/picture.rb', line 4 def typeform_id @typeform_id end |
Instance Method Details
#to_json ⇒ Object
30 31 32 33 34 |
# File 'lib/ask_awesomely/picture.rb', line 30 def to_json(*) { url: public_url, }.to_json end |